basic.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930
  1. import type { ComponentPublicInstance } from 'vue';
  2. export declare function noop(): void;
  3. export declare const extend: {
  4. <T extends {}, U>(target: T, source: U): T & U;
  5. <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
  6. <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
  7. (target: object, ...sources: any[]): any;
  8. };
  9. export declare const inBrowser: boolean;
  10. export type Numeric = number | string;
  11. export type ComponentInstance = ComponentPublicInstance<{}, any>;
  12. export declare const isObject: (val: unknown) => val is Record<any, any>;
  13. export declare const isDef: <T>(val: T) => val is NonNullable<T>;
  14. export declare const isFunction: (val: unknown) => val is Function;
  15. export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
  16. export declare const isDate: (val: unknown) => val is Date;
  17. export declare function isMobile(value: string): boolean;
  18. export declare const isNumeric: (val: Numeric) => val is string;
  19. export declare const isIOS: () => boolean;
  20. export declare function get(object: any, path: string): any;
  21. export type Writeable<T> = {
  22. -readonly [P in keyof T]: T[P];
  23. };
  24. export type RequiredParams<T> = T extends (...args: infer P) => infer R ? (...args: {
  25. [K in keyof P]-?: NonNullable<P[K]>;
  26. }) => R : never;
  27. export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>, ignoreUndefined?: boolean): Writeable<Pick<T, U>>;
  28. export declare const isSameValue: (newValue: unknown, oldValue: unknown) => boolean;
  29. export declare const toArray: <T>(item: T | T[]) => T[];
  30. export declare const flat: <T>(arr: Array<T | T[]>) => T[];