@@ -54,3 +54,182 @@ async function fn4(): Promise<Obj> {
5454
5555 });
5656}
57+
58+ declare class Context {
59+ >Context : Symbol(Context, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 20, 1))
60+
61+ private _runnable;
62+ >_runnable : Symbol(Context._runnable, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 22, 23))
63+ }
64+ type Done = (err?: any) => void;
65+ >Done : Symbol(Done, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 24, 1))
66+ >err : Symbol(err, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 25, 13))
67+
68+ type Func = (this: Context, done: Done) => void;
69+ >Func : Symbol(Func, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 25, 32))
70+ >this : Symbol(this, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 26, 13))
71+ >Context : Symbol(Context, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 20, 1))
72+ >done : Symbol(done, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 26, 27))
73+ >Done : Symbol(Done, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 24, 1))
74+
75+ type AsyncFunc = (this: Context) => PromiseLike<any>;
76+ >AsyncFunc : Symbol(AsyncFunc, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 26, 48))
77+ >this : Symbol(this, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 27, 18))
78+ >Context : Symbol(Context, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 20, 1))
79+ >PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
80+
81+ interface TestFunction {
82+ >TestFunction : Symbol(TestFunction, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 27, 53))
83+
84+ (fn: Func): void;
85+ >fn : Symbol(fn, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 30, 3))
86+ >Func : Symbol(Func, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 25, 32))
87+
88+ (fn: AsyncFunc): void;
89+ >fn : Symbol(fn, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 31, 3))
90+ >AsyncFunc : Symbol(AsyncFunc, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 26, 48))
91+
92+ (title: string, fn?: Func): void;
93+ >title : Symbol(title, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 32, 3))
94+ >fn : Symbol(fn, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 32, 17))
95+ >Func : Symbol(Func, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 25, 32))
96+
97+ (title: string, fn?: AsyncFunc): void;
98+ >title : Symbol(title, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 33, 3))
99+ >fn : Symbol(fn, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 33, 17))
100+ >AsyncFunc : Symbol(AsyncFunc, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 26, 48))
101+ }
102+
103+ declare const test: TestFunction;
104+ >test : Symbol(test, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 36, 13))
105+ >TestFunction : Symbol(TestFunction, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 27, 53))
106+
107+ interface ProcessTreeNode {
108+ >ProcessTreeNode : Symbol(ProcessTreeNode, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 36, 33))
109+
110+ pid: number;
111+ >pid : Symbol(ProcessTreeNode.pid, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 38, 27))
112+
113+ name: string;
114+ >name : Symbol(ProcessTreeNode.name, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 39, 14))
115+
116+ memory?: number;
117+ >memory : Symbol(ProcessTreeNode.memory, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 40, 15))
118+
119+ commandLine?: string;
120+ >commandLine : Symbol(ProcessTreeNode.commandLine, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 41, 18))
121+
122+ children: ProcessTreeNode[];
123+ >children : Symbol(ProcessTreeNode.children, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 42, 23))
124+ >ProcessTreeNode : Symbol(ProcessTreeNode, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 36, 33))
125+ }
126+
127+ export declare function getProcessTree(
128+ >getProcessTree : Symbol(getProcessTree, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 44, 1))
129+
130+ rootPid: number,
131+ >rootPid : Symbol(rootPid, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 46, 39))
132+
133+ callback: (tree: ProcessTreeNode) => void
134+ >callback : Symbol(callback, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 47, 18))
135+ >tree : Symbol(tree, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 48, 13))
136+ >ProcessTreeNode : Symbol(ProcessTreeNode, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 36, 33))
137+
138+ ): void;
139+
140+ test("windows-process-tree", async () => {
141+ >test : Symbol(test, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 36, 13))
142+
143+ return new Promise((resolve, reject) => {
144+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
145+ >resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 52, 22))
146+ >reject : Symbol(reject, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 52, 30))
147+
148+ getProcessTree(123, (tree) => {
149+ >getProcessTree : Symbol(getProcessTree, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 44, 1))
150+ >tree : Symbol(tree, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 53, 25))
151+
152+ if (tree) {
153+ >tree : Symbol(tree, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 53, 25))
154+
155+ resolve();
156+ >resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 52, 22))
157+
158+ } else {
159+ reject(new Error("windows-process-tree"));
160+ >reject : Symbol(reject, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 52, 30))
161+ >Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --))
162+ }
163+ });
164+ });
165+ });
166+
167+ interface ILocalExtension {
168+ >ILocalExtension : Symbol(ILocalExtension, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 61, 3))
169+
170+ isApplicationScoped: boolean;
171+ >isApplicationScoped : Symbol(ILocalExtension.isApplicationScoped, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 63, 27))
172+
173+ publisherId: string | null;
174+ >publisherId : Symbol(ILocalExtension.publisherId, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 64, 31))
175+ }
176+ type Metadata = {
177+ >Metadata : Symbol(Metadata, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 66, 1))
178+
179+ updated: boolean;
180+ >updated : Symbol(updated, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 67, 17))
181+
182+ };
183+ declare function scanMetadata(
184+ >scanMetadata : Symbol(scanMetadata, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 69, 2))
185+
186+ local: ILocalExtension
187+ >local : Symbol(local, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 70, 30))
188+ >ILocalExtension : Symbol(ILocalExtension, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 61, 3))
189+
190+ ): Promise<Metadata | undefined>;
191+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
192+ >Metadata : Symbol(Metadata, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 66, 1))
193+
194+ async function copyExtensions(
195+ >copyExtensions : Symbol(copyExtensions, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 72, 33))
196+
197+ fromExtensions: ILocalExtension[]
198+ >fromExtensions : Symbol(fromExtensions, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 74, 30))
199+ >ILocalExtension : Symbol(ILocalExtension, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 61, 3))
200+
201+ ): Promise<void> {
202+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
203+
204+ const extensions: [ILocalExtension, Metadata | undefined][] =
205+ >extensions : Symbol(extensions, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 77, 7))
206+ >ILocalExtension : Symbol(ILocalExtension, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 61, 3))
207+ >Metadata : Symbol(Metadata, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 66, 1))
208+
209+ await Promise.all(
210+ >Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
211+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
212+ >all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
213+
214+ fromExtensions
215+ >fromExtensions .filter((e) => !e.isApplicationScoped) .map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
216+ >fromExtensions .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
217+ >fromExtensions : Symbol(fromExtensions, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 74, 30))
218+
219+ .filter((e) => !e.isApplicationScoped)
220+ >filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
221+ >e : Symbol(e, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 80, 17))
222+ >e.isApplicationScoped : Symbol(ILocalExtension.isApplicationScoped, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 63, 27))
223+ >e : Symbol(e, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 80, 17))
224+ >isApplicationScoped : Symbol(ILocalExtension.isApplicationScoped, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 63, 27))
225+
226+ .map(async (e) => [e, await scanMetadata(e)])
227+ >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
228+ >e : Symbol(e, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 81, 20))
229+ >e : Symbol(e, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 81, 20))
230+ >scanMetadata : Symbol(scanMetadata, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 69, 2))
231+ >e : Symbol(e, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 81, 20))
232+
233+ );
234+ }
235+
0 commit comments