-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nested translation + fix undefined
kind
+ add tests
- Loading branch information
Showing
13 changed files
with
4,066 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"@babel/env", | ||
["@babel/typescript", {"allowNamespaces": true}] | ||
], | ||
"plugins": [ | ||
["@babel/plugin-proposal-decorators", {"legacy": true}], | ||
"@babel/plugin-transform-runtime", | ||
"@babel/proposal-class-properties", | ||
"@babel/proposal-object-rest-spread" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from "react"; | ||
import {SimpleTranslation} from "./Simple"; | ||
|
||
interface ExtendTranslation extends SimpleTranslation { | ||
d: string; | ||
e: string; | ||
} | ||
|
||
interface IProps { | ||
something: string; | ||
somethingElse: number; | ||
translation: ExtendTranslation; | ||
} | ||
|
||
export class Extend extends React.Component<IProps> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from "react"; | ||
|
||
interface Customer { | ||
age: number; | ||
firstName: string; | ||
lastName: string; | ||
} | ||
|
||
interface IProps { | ||
something: string; | ||
somethingElse: number; | ||
translation: Record<keyof Customer, string>; | ||
} | ||
|
||
export class Infer extends React.Component<IProps> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from "react"; | ||
|
||
export interface Nested { | ||
translation: { | ||
a: string; | ||
b: string; | ||
} | ||
} | ||
|
||
export interface DoubleNested { | ||
something: { | ||
translation: { | ||
c: string; | ||
d: string; | ||
} | ||
} | ||
} | ||
|
||
export interface TripNested { | ||
something: { | ||
somethingElse: { | ||
translation: { | ||
e: string; | ||
f: string; | ||
} | ||
} | ||
} | ||
} | ||
|
||
interface IProps { | ||
nested: Nested; | ||
doubleNested: DoubleNested; | ||
tripleNested: TripNested; | ||
} | ||
|
||
export class Nested extends React.Component<IProps> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as React from "react"; | ||
|
||
export class NoProps extends React.Component {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from "react"; | ||
|
||
export interface SimpleTranslation { | ||
a: string; | ||
b: string; | ||
c: string; | ||
} | ||
|
||
interface IProps { | ||
something: string; | ||
somethingElse: number; | ||
translation: SimpleTranslation; | ||
} | ||
|
||
export class Simple extends React.Component<IProps> {} |
Oops, something went wrong.