global.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. type NonFalsy<T> = T extends false | 0 | "" | null | undefined | 0n ? never : T;
  2. interface Array<T> {
  3. includes(searchElement: unknown, fromIndex?: number): searchElement is T;
  4. }
  5. interface ReadonlyArray<T> {
  6. includes(searchElement: unknown, fromIndex?: number): searchElement is T;
  7. }
  8. interface Body {
  9. json(): Promise<unknown>;
  10. }
  11. interface Array<T> {
  12. filter(predicate: BooleanConstructor, thisArg?: unknown): NonFalsy<T>[];
  13. }
  14. interface ReadonlyArray<T> {
  15. filter(predicate: BooleanConstructor, thisArg?: unknown): NonFalsy<T>[];
  16. }
  17. interface ArrayConstructor {
  18. isArray(arg: unknown): arg is unknown[];
  19. }
  20. interface JSON {
  21. /**
  22. * Converts a JavaScript Object Notation (JSON) string into an object.
  23. * @param text A valid JSON string.
  24. * @param reviver A function that transforms the results. This function is called for each member of the object.
  25. * If a member contains nested objects, the nested objects are transformed before the parent object is.
  26. */
  27. parse(text: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): unknown;
  28. }
  29. interface Set<T> {
  30. has(value: unknown): value is T;
  31. }