uni-shared.d.ts 2.2 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5

export declare const BUILT_IN_TAGS: string[];

export declare const COMPONENT_NAME_PREFIX = "VUni";

fxy060608's avatar
fxy060608 已提交
6 7 8
export declare const COMPONENT_PREFIX: string;

export declare const COMPONENT_SELECTOR_PREFIX = "uni-";
fxy060608's avatar
fxy060608 已提交
9 10 11 12 13 14

export declare function debounce(fn: Function, delay: number): {
    (this: any): void;
    cancel(): void;
};

fxy060608's avatar
fxy060608 已提交
15 16 17 18 19 20 21 22 23 24 25
/**
 * Decode text using `decodeURIComponent`. Returns the original text if it
 * fails.
 *
 * @param text - string to decode
 * @returns decoded string
 */
export declare function decode(text: string | number): string;

export declare function decodedQuery(query?: Record<string, any>): Record<string, string>;

fxy060608's avatar
fxy060608 已提交
26 27
export declare function getLen(str?: string): number;

fxy060608's avatar
fxy060608 已提交
28 29
export declare const invokeArrayFns: (fns: Function[], arg?: any) => any;

fxy060608's avatar
fxy060608 已提交
30 31 32 33 34 35 36 37
export declare function isBuiltInComponent(tag: string): boolean;

export declare function isCustomElement(tag: string): boolean;

export declare function isNativeTag(tag: string): boolean;

export declare const NAVBAR_HEIGHT = 44;

fxy060608's avatar
fxy060608 已提交
38 39
export declare function normalizeDataset(el: Element): any;

fxy060608's avatar
fxy060608 已提交
40 41 42 43 44 45 46
export declare function normalizeTarget(el: HTMLElement): {
    id: string;
    dataset: any;
    offsetTop: number;
    offsetLeft: number;
};

fxy060608's avatar
fxy060608 已提交
47 48
export declare function once(fn: (...args: any[]) => any, ctx?: unknown): (...args: any[]) => any;

fxy060608's avatar
fxy060608 已提交
49 50 51 52 53 54 55 56 57
/**
 * https://github.com/vuejs/vue-router-next/blob/master/src/query.ts
 * @internal
 *
 * @param search - search string to parse
 * @returns a query object
 */
export declare function parseQuery(search: string): Record<string, any>;

fxy060608's avatar
fxy060608 已提交
58 59 60 61
export declare function passive(passive: boolean): {
    passive: boolean;
};

fxy060608's avatar
fxy060608 已提交
62 63
export declare const PLUS_RE: RegExp;

fxy060608's avatar
fxy060608 已提交
64 65
export declare function plusReady(callback: () => void): void;

fxy060608's avatar
fxy060608 已提交
66 67
export declare const PRIMARY_COLOR = "#007aff";

fxy060608's avatar
fxy060608 已提交
68 69
export declare function removeLeadingSlash(str: string): string;

fxy060608's avatar
fxy060608 已提交
70 71
export declare const RESPONSIVE_MIN_WIDTH = 768;

fxy060608's avatar
fxy060608 已提交
72 73 74 75 76 77
export declare function stringifyQuery(obj?: Record<string, any>, encodeStr?: typeof encodeURIComponent): string;

export declare const TABBAR_HEIGHT = 50;

export declare const TAGS: string[];

fxy060608's avatar
fxy060608 已提交
78 79
export declare function updateElementStyle(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;

fxy060608's avatar
fxy060608 已提交
80
export { }