global.d.ts 304 B

123456789101112131415161718
  1. export {};
  2. declare global {
  3. /**
  4. * Promise 扩展
  5. */
  6. interface PromiseConstructor {
  7. withResolvers<T>(): {
  8. promise: Promise<T>;
  9. resolve: (value: T | PromiseLike<T>) => void;
  10. reject: (reason?: any) => void;
  11. };
  12. }
  13. interface Array<T> {
  14. at(index: number): T;
  15. }
  16. }