|
| 1 | +import type { MyImportedTypeAlias } from './typesUtils' |
| 2 | +export type { ReExportedInterface } from './typesUtils' |
| 3 | +export type MyExportedTypeAlias = { a: number } |
| 4 | +type MyTypeAlias = { a: number } |
| 5 | +export interface MyExportedInterface { |
| 6 | + a: number |
| 7 | +} |
| 8 | +interface MyInterface { |
| 9 | + a: number |
| 10 | +} |
| 11 | + |
| 12 | +/** |
| 13 | + * This is the description of the Button component's props |
| 14 | + */ |
| 15 | +export interface ButtonProps<TestGenerics extends string> extends Base { |
| 16 | + /** |
| 17 | + * the type of button |
| 18 | + * @defaultValue 'default' |
| 19 | + */ |
| 20 | + type?: 'primary' | 'default' | 'text' |
| 21 | + /** |
| 22 | + * the size of button |
| 23 | + * @defaultValue 'middle' |
| 24 | + */ |
| 25 | + size?: 'large' | 'middle' | 'small' | TestGenerics |
| 26 | + /** |
| 27 | + * loading state of button |
| 28 | + * @defaultValue false |
| 29 | + */ |
| 30 | + loading?: boolean |
| 31 | + /** |
| 32 | + * click handler |
| 33 | + */ |
| 34 | + onClick?: (event: React.MouseEvent) => void |
| 35 | + /** test method declaration */ |
| 36 | + testMethod(param: MyExportedTypeAlias): MyTypeAlias |
| 37 | + /** test required property */ |
| 38 | + testRequired: boolean |
| 39 | + myExportedTypeAlias: MyExportedTypeAlias |
| 40 | + myTypeAlias: MyTypeAlias |
| 41 | + myExportedInterface: MyExportedInterface |
| 42 | + myInterface: MyInterface |
| 43 | + myImportedTypeAlias: MyImportedTypeAlias |
| 44 | + /** test call signatures */ |
| 45 | + (options?: { ignorePending?: true }): Array<string | Promise<string>> |
| 46 | + (options: { ignorePending: false }): string[] |
| 47 | + /** test construct signatures */ |
| 48 | + new (options: string): MyInterface |
| 49 | + new (): MyInterface |
| 50 | +} |
| 51 | + |
| 52 | +interface Base { |
| 53 | + /** |
| 54 | + * children content |
| 55 | + */ |
| 56 | + children: React.ReactNode |
| 57 | +} |
| 58 | + |
| 59 | +export type SomeObjectLiteralType<TestGenerics> = { |
| 60 | + /** |
| 61 | + * the type of button |
| 62 | + * @defaultValue 'default' |
| 63 | + */ |
| 64 | + type?: 'primary' | 'default' | 'text' |
| 65 | + /** |
| 66 | + * the size of button |
| 67 | + * @defaultValue 'middle' |
| 68 | + */ |
| 69 | + size?: 'large' | 'middle' | 'small' | TestGenerics |
| 70 | + /** |
| 71 | + * loading state of button |
| 72 | + * @defaultValue false |
| 73 | + */ |
| 74 | + loading?: boolean |
| 75 | + /** |
| 76 | + * click handler |
| 77 | + */ |
| 78 | + onClick?: (event: React.MouseEvent) => void |
| 79 | + /** test method declaration */ |
| 80 | + testMethod(param: MyInterface): MyExportedInterface |
| 81 | + /** test required property */ |
| 82 | + testRequired: boolean |
| 83 | + myExportedTypeAlias: MyExportedTypeAlias |
| 84 | + myTypeAlias: MyTypeAlias |
| 85 | + myExportedInterface: MyExportedInterface |
| 86 | + myInterface: MyInterface |
| 87 | + myImportedTypeAlias: MyImportedTypeAlias |
| 88 | + /** test call signatures */ |
| 89 | + (options?: { ignorePending?: true }): Array<string | Promise<string>> |
| 90 | + (options: { ignorePending: false }): string[] |
| 91 | + /** test construct signatures */ |
| 92 | + new (options: string): MyInterface |
| 93 | + new (): MyInterface |
| 94 | +} |
| 95 | + |
| 96 | +/** |
| 97 | + * Description of SomeComplexType ... |
| 98 | + */ |
| 99 | +export type SomeComplexType = 0 | 1 | 'a' | 'b' | { key: string } |
0 commit comments