Skip to content

Commit fa9d159

Browse files
author
zhaozhou
committed
feat
1 parent eb520c0 commit fa9d159

File tree

1 file changed

+19
-1
lines changed
  • new/docs/typescript

1 file changed

+19
-1
lines changed

new/docs/typescript/1.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,22 @@ type ElementOf<T> = T extends Array<infer E> ? E : T;
6565
type avava = ElementOf<string []>
6666
type adada = ElementOf<number []>
6767
type booleanadada = ElementOf<boolean []>
68-
type boolea21nadada = ElementOf<{name: string}>
68+
type boolea21nadada = ElementOf<{name: string}>
69+
70+
71+
function p(): Promise<{data: any [], code: number, msg: string | undefined}> {
72+
return new Promise((resolve, reject) => {
73+
setTimeout(() => {
74+
resolve({data: [], code: 200, msg: 'success'})
75+
}, 1000 * 3);
76+
77+
})
78+
}
79+
80+
p().then(result => {
81+
82+
})
83+
84+
let str1 = 'abc';
85+
// str1 = 'cna'
86+
<boolean>str1 = false

0 commit comments

Comments
 (0)