All files / func.ts

100.00% Branches 0/0
100.00% Lines 9/9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
x1
x1
x2
 
x2
x2
 
 
 
 
 
 
 
 
 
 
 
x2
x2
 
 
 
 
 
 
 
 
 
 
 
x2
x2
 
 
 
 
 
 
 
 
 
 







































// deno-lint-ignore-file no-explicit-any
// Imports
import { functions } from "./_func.ts"

/** Async function constructor. */
export const AsyncFunction = Object.getPrototypeOf(functions.async).constructor as AsyncFunctionConstructor

/** Async function constructor interface. */
export interface AsyncFunctionConstructor {
  /** Constructor. */
  new <T = any>(...args: string[]): (...args: unknown[]) => Promise<T>
  /** Signature. */
  <T = any>(...args: string[]): (...args: unknown[]) => Promise<T>
  /** Prototype. */
  readonly prototype: <T = any>(...args: unknown[]) => Promise<T>
}

/** Generator function constructor. */
export const GeneratorFunction = Object.getPrototypeOf(functions.generator).constructor as GeneratorFunctionConstructor

/** Generator function constructor interface. */
export interface GeneratorFunctionConstructor {
  /** Constructor. */
  new <T = unknown, TReturn = any, TNext = unknown>(...args: string[]): (...args: unknown[]) => Generator<T, TReturn, TNext>
  /** Signature. */
  <T = unknown, TReturn = any, TNext = unknown>(...args: string[]): (...args: unknown[]) => Generator<T, TReturn, TNext>
  /** Prototype. */
  readonly prototype: <T = unknown, TReturn = any, TNext = unknown>(...args: unknown[]) => Generator<T, TReturn, TNext>
}

/** Async genreator function constructor. */
export const AsyncGeneratorFunction = Object.getPrototypeOf(functions.asyncGenerator).constructor as AsyncGeneratorFunctionConstructor

/** Async generator function constructor interface. */
export interface AsyncGeneratorFunctionConstructor {
  /** Constructor. */
  new <T = unknown, TReturn = any, TNext = unknown>(...args: string[]): (...args: unknown[]) => AsyncGenerator<T, TReturn, TNext>
  /** Signature. */
  <T = unknown, TReturn = any, TNext = unknown>(...args: string[]): (...args: unknown[]) => AsyncGenerator<T, TReturn, TNext>
  /** Prototype. */
  readonly prototype: <T = unknown, TReturn = any, TNext = unknown>(...args: unknown[]) => AsyncGenerator<T, TReturn, TNext>
}