11cb0ef41Sopenharmony_ciimport { owner_symbol } from './symbols';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cideclare namespace InternalAsyncWrapBinding {
41cb0ef41Sopenharmony_ci  interface Resource {
51cb0ef41Sopenharmony_ci    [owner_symbol]?: PublicResource;
61cb0ef41Sopenharmony_ci  }
71cb0ef41Sopenharmony_ci  type PublicResource = object;
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci  type EmitHook = (asyncId: number) => void;
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci  type PromiseHook = (promise: Promise<unknown>, parent: Promise<unknown>) => void;
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci  interface Providers {
141cb0ef41Sopenharmony_ci    NONE: 0;
151cb0ef41Sopenharmony_ci    DIRHANDLE: 1;
161cb0ef41Sopenharmony_ci    DNSCHANNEL: 2;
171cb0ef41Sopenharmony_ci    ELDHISTOGRAM: 3;
181cb0ef41Sopenharmony_ci    FILEHANDLE: 4;
191cb0ef41Sopenharmony_ci    FILEHANDLECLOSEREQ: 5;
201cb0ef41Sopenharmony_ci    FIXEDSIZEBLOBCOPY: 6;
211cb0ef41Sopenharmony_ci    FSEVENTWRAP: 7;
221cb0ef41Sopenharmony_ci    FSREQCALLBACK: 8;
231cb0ef41Sopenharmony_ci    FSREQPROMISE: 9;
241cb0ef41Sopenharmony_ci    GETADDRINFOREQWRAP: 10;
251cb0ef41Sopenharmony_ci    GETNAMEINFOREQWRAP: 11;
261cb0ef41Sopenharmony_ci    HEAPSNAPSHOT: 12;
271cb0ef41Sopenharmony_ci    HTTP2SESSION: 13;
281cb0ef41Sopenharmony_ci    HTTP2STREAM: 14;
291cb0ef41Sopenharmony_ci    HTTP2PING: 15;
301cb0ef41Sopenharmony_ci    HTTP2SETTINGS: 16;
311cb0ef41Sopenharmony_ci    HTTPINCOMINGMESSAGE: 17;
321cb0ef41Sopenharmony_ci    HTTPCLIENTREQUEST: 18;
331cb0ef41Sopenharmony_ci    JSSTREAM: 19;
341cb0ef41Sopenharmony_ci    JSUDPWRAP: 20;
351cb0ef41Sopenharmony_ci    MESSAGEPORT: 21;
361cb0ef41Sopenharmony_ci    PIPECONNECTWRAP: 22;
371cb0ef41Sopenharmony_ci    PIPESERVERWRAP: 23;
381cb0ef41Sopenharmony_ci    PIPEWRAP: 24;
391cb0ef41Sopenharmony_ci    PROCESSWRAP: 25;
401cb0ef41Sopenharmony_ci    PROMISE: 26;
411cb0ef41Sopenharmony_ci    QUERYWRAP: 27;
421cb0ef41Sopenharmony_ci    SHUTDOWNWRAP: 28;
431cb0ef41Sopenharmony_ci    SIGNALWRAP: 29;
441cb0ef41Sopenharmony_ci    STATWATCHER: 30;
451cb0ef41Sopenharmony_ci    STREAMPIPE: 31;
461cb0ef41Sopenharmony_ci    TCPCONNECTWRAP: 32;
471cb0ef41Sopenharmony_ci    TCPSERVERWRAP: 33;
481cb0ef41Sopenharmony_ci    TCPWRAP: 34;
491cb0ef41Sopenharmony_ci    TTYWRAP: 35;
501cb0ef41Sopenharmony_ci    UDPSENDWRAP: 36;
511cb0ef41Sopenharmony_ci    UDPWRAP: 37;
521cb0ef41Sopenharmony_ci    SIGINTWATCHDOG: 38;
531cb0ef41Sopenharmony_ci    WORKER: 39;
541cb0ef41Sopenharmony_ci    WORKERHEAPSNAPSHOT: 40;
551cb0ef41Sopenharmony_ci    WRITEWRAP: 41;
561cb0ef41Sopenharmony_ci    ZLIB: 42;
571cb0ef41Sopenharmony_ci    CHECKPRIMEREQUEST: 43;
581cb0ef41Sopenharmony_ci    PBKDF2REQUEST: 44;
591cb0ef41Sopenharmony_ci    KEYPAIRGENREQUEST: 45;
601cb0ef41Sopenharmony_ci    KEYGENREQUEST: 46;
611cb0ef41Sopenharmony_ci    KEYEXPORTREQUEST: 47;
621cb0ef41Sopenharmony_ci    CIPHERREQUEST: 48;
631cb0ef41Sopenharmony_ci    DERIVEBITSREQUEST: 49;
641cb0ef41Sopenharmony_ci    HASHREQUEST: 50;
651cb0ef41Sopenharmony_ci    RANDOMBYTESREQUEST: 51;
661cb0ef41Sopenharmony_ci    RANDOMPRIMEREQUEST: 52;
671cb0ef41Sopenharmony_ci    SCRYPTREQUEST: 53;
681cb0ef41Sopenharmony_ci    SIGNREQUEST: 54;
691cb0ef41Sopenharmony_ci    TLSWRAP: 55;
701cb0ef41Sopenharmony_ci    VERIFYREQUEST: 56;
711cb0ef41Sopenharmony_ci    INSPECTORJSBINDING: 57;
721cb0ef41Sopenharmony_ci  }
731cb0ef41Sopenharmony_ci}
741cb0ef41Sopenharmony_ci
751cb0ef41Sopenharmony_cideclare function InternalBinding(binding: 'async_wrap'): {
761cb0ef41Sopenharmony_ci  setupHooks(): {
771cb0ef41Sopenharmony_ci    init: (
781cb0ef41Sopenharmony_ci      asyncId: number,
791cb0ef41Sopenharmony_ci      type: keyof InternalAsyncWrapBinding.Providers,
801cb0ef41Sopenharmony_ci      triggerAsyncId: number,
811cb0ef41Sopenharmony_ci      resource: InternalAsyncWrapBinding.Resource,
821cb0ef41Sopenharmony_ci    ) => void;
831cb0ef41Sopenharmony_ci    before: InternalAsyncWrapBinding.EmitHook;
841cb0ef41Sopenharmony_ci    after: InternalAsyncWrapBinding.EmitHook;
851cb0ef41Sopenharmony_ci    destroy: InternalAsyncWrapBinding.EmitHook;
861cb0ef41Sopenharmony_ci    promise_resolve: InternalAsyncWrapBinding.EmitHook;
871cb0ef41Sopenharmony_ci  };
881cb0ef41Sopenharmony_ci  setCallbackTrampoline(
891cb0ef41Sopenharmony_ci    callback: (
901cb0ef41Sopenharmony_ci      asyncId: number,
911cb0ef41Sopenharmony_ci      resource: InternalAsyncWrapBinding.Resource,
921cb0ef41Sopenharmony_ci      cb: (
931cb0ef41Sopenharmony_ci        cb: (...args: any[]) => boolean | undefined,
941cb0ef41Sopenharmony_ci        ...args: any[]
951cb0ef41Sopenharmony_ci      ) => boolean | undefined,
961cb0ef41Sopenharmony_ci      ...args: any[]
971cb0ef41Sopenharmony_ci    ) => boolean | undefined
981cb0ef41Sopenharmony_ci  ): void;
991cb0ef41Sopenharmony_ci  pushAsyncContext(asyncId: number, triggerAsyncId: number): void;
1001cb0ef41Sopenharmony_ci  popAsyncContext(asyncId: number): boolean;
1011cb0ef41Sopenharmony_ci  executionAsyncResource(index: number): InternalAsyncWrapBinding.PublicResource | null;
1021cb0ef41Sopenharmony_ci  clearAsyncIdStack(): void;
1031cb0ef41Sopenharmony_ci  queueDestroyAsyncId(asyncId: number): void;
1041cb0ef41Sopenharmony_ci  setPromiseHooks(
1051cb0ef41Sopenharmony_ci    initHook: ((promise: Promise<unknown>, parent?: Promise<unknown>) => void) | undefined,
1061cb0ef41Sopenharmony_ci    promiseBeforeHook: InternalAsyncWrapBinding.PromiseHook | undefined,
1071cb0ef41Sopenharmony_ci    promiseAfterHook: InternalAsyncWrapBinding.PromiseHook | undefined,
1081cb0ef41Sopenharmony_ci    promiseResolveHook: InternalAsyncWrapBinding.PromiseHook | undefined
1091cb0ef41Sopenharmony_ci  ): void;
1101cb0ef41Sopenharmony_ci  registerDestroyHook(resource: object, asyncId: number, destroyed?: { destroyed: boolean }): void;
1111cb0ef41Sopenharmony_ci  async_hook_fields: Uint32Array;
1121cb0ef41Sopenharmony_ci  async_id_fields: Float64Array;
1131cb0ef41Sopenharmony_ci  async_ids_stack: Float64Array;
1141cb0ef41Sopenharmony_ci  execution_async_resources: InternalAsyncWrapBinding.Resource[];
1151cb0ef41Sopenharmony_ci  constants: {
1161cb0ef41Sopenharmony_ci    kInit: 0;
1171cb0ef41Sopenharmony_ci    kBefore: 1;
1181cb0ef41Sopenharmony_ci    kAfter: 2;
1191cb0ef41Sopenharmony_ci    kDestroy: 3;
1201cb0ef41Sopenharmony_ci    kPromiseResolve: 4;
1211cb0ef41Sopenharmony_ci    kTotals: 5;
1221cb0ef41Sopenharmony_ci    kCheck: 6;
1231cb0ef41Sopenharmony_ci    kStackLength: 7;
1241cb0ef41Sopenharmony_ci    kUsesExecutionAsyncResource: 8;
1251cb0ef41Sopenharmony_ci
1261cb0ef41Sopenharmony_ci    kExecutionAsyncId: 0;
1271cb0ef41Sopenharmony_ci    kTriggerAsyncId: 1;
1281cb0ef41Sopenharmony_ci    kAsyncIdCounter: 2;
1291cb0ef41Sopenharmony_ci    kDefaultTriggerAsyncId: 3;
1301cb0ef41Sopenharmony_ci  };
1311cb0ef41Sopenharmony_ci  Providers: InternalAsyncWrapBinding.Providers;
1321cb0ef41Sopenharmony_ci};
133