|
| 1 | +=== tests/cases/compiler/templateLiteralIntersection4.ts === |
| 2 | +type StateHook<S> = () => [S, unknown]; |
| 3 | +>StateHook : Symbol(StateHook, Decl(templateLiteralIntersection4.ts, 0, 0)) |
| 4 | +>S : Symbol(S, Decl(templateLiteralIntersection4.ts, 0, 15)) |
| 5 | +>S : Symbol(S, Decl(templateLiteralIntersection4.ts, 0, 15)) |
| 6 | + |
| 7 | +type StoreUtils<Store extends { [K: string]: any }> = Omit<{ |
| 8 | +>StoreUtils : Symbol(StoreUtils, Decl(templateLiteralIntersection4.ts, 0, 39)) |
| 9 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 2, 16)) |
| 10 | +>K : Symbol(K, Decl(templateLiteralIntersection4.ts, 2, 33)) |
| 11 | +>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --)) |
| 12 | + |
| 13 | + [K in keyof Store as `use${Capitalize<string & K>}`]: StateHook<Store[K]> |
| 14 | +>K : Symbol(K, Decl(templateLiteralIntersection4.ts, 3, 5)) |
| 15 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 2, 16)) |
| 16 | +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) |
| 17 | +>K : Symbol(K, Decl(templateLiteralIntersection4.ts, 3, 5)) |
| 18 | +>StateHook : Symbol(StateHook, Decl(templateLiteralIntersection4.ts, 0, 0)) |
| 19 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 2, 16)) |
| 20 | +>K : Symbol(K, Decl(templateLiteralIntersection4.ts, 3, 5)) |
| 21 | + |
| 22 | +}, 'useStore'> & { |
| 23 | + Provider: unknown, |
| 24 | +>Provider : Symbol(Provider, Decl(templateLiteralIntersection4.ts, 4, 18)) |
| 25 | + |
| 26 | + useStore: StateHook<Store> |
| 27 | +>useStore : Symbol(useStore, Decl(templateLiteralIntersection4.ts, 5, 20)) |
| 28 | +>StateHook : Symbol(StateHook, Decl(templateLiteralIntersection4.ts, 0, 0)) |
| 29 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 2, 16)) |
| 30 | + |
| 31 | +}; |
| 32 | + |
| 33 | +declare function createStore<Store extends { [K: string]: any }>(store: Store): StoreUtils<Store>; |
| 34 | +>createStore : Symbol(createStore, Decl(templateLiteralIntersection4.ts, 7, 2)) |
| 35 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 9, 29)) |
| 36 | +>K : Symbol(K, Decl(templateLiteralIntersection4.ts, 9, 46)) |
| 37 | +>store : Symbol(store, Decl(templateLiteralIntersection4.ts, 9, 65)) |
| 38 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 9, 29)) |
| 39 | +>StoreUtils : Symbol(StoreUtils, Decl(templateLiteralIntersection4.ts, 0, 39)) |
| 40 | +>Store : Symbol(Store, Decl(templateLiteralIntersection4.ts, 9, 29)) |
| 41 | + |
| 42 | +const { Provider, useUsername, useAge, useStore } = createStore({ |
| 43 | +>Provider : Symbol(Provider, Decl(templateLiteralIntersection4.ts, 11, 7)) |
| 44 | +>useUsername : Symbol(useUsername, Decl(templateLiteralIntersection4.ts, 11, 17)) |
| 45 | +>useAge : Symbol(useAge, Decl(templateLiteralIntersection4.ts, 11, 30)) |
| 46 | +>useStore : Symbol(useStore, Decl(templateLiteralIntersection4.ts, 11, 38)) |
| 47 | +>createStore : Symbol(createStore, Decl(templateLiteralIntersection4.ts, 7, 2)) |
| 48 | + |
| 49 | + username: "Aral", |
| 50 | +>username : Symbol(username, Decl(templateLiteralIntersection4.ts, 11, 65)) |
| 51 | + |
| 52 | + age: 31 |
| 53 | +>age : Symbol(age, Decl(templateLiteralIntersection4.ts, 12, 19)) |
| 54 | + |
| 55 | +}); |
| 56 | + |
0 commit comments