uni-shared.d.ts 2.6 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3
import { FontFaceDescriptors } from 'css-font-loading-module';

export declare function addFont(family: string, source: string, desc?: FontFaceDescriptors): Promise<void>;
fxy060608's avatar
fxy060608 已提交
4 5 6 7 8

export declare const BUILT_IN_TAGS: string[];

export declare const COMPONENT_NAME_PREFIX = "VUni";

fxy060608's avatar
fxy060608 已提交
9 10 11
export declare const COMPONENT_PREFIX: string;

export declare const COMPONENT_SELECTOR_PREFIX = "uni-";
fxy060608's avatar
fxy060608 已提交
12 13 14 15 16 17

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

fxy060608's avatar
fxy060608 已提交
18 19 20 21 22 23 24 25 26 27 28
/**
 * 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 已提交
29 30
export declare function getEnvLocale(): string;

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

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

fxy060608's avatar
fxy060608 已提交
35 36 37 38 39 40 41 42
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 已提交
43 44
export declare function normalizeDataset(el: Element): any;

fxy060608's avatar
fxy060608 已提交
45 46 47 48 49 50 51
export declare function normalizeTarget(el: HTMLElement): {
    id: string;
    dataset: any;
    offsetTop: number;
    offsetLeft: number;
};

fxy060608's avatar
fxy060608 已提交
52 53
export declare const ON_REACH_BOTTOM_DISTANCE = 50;

fxy060608's avatar
fxy060608 已提交
54
export declare function once<T extends (...args: any[]) => any>(fn: T, ctx?: unknown): T;
fxy060608's avatar
fxy060608 已提交
55

fxy060608's avatar
fxy060608 已提交
56 57 58 59 60 61 62 63 64
/**
 * 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 已提交
65 66 67 68
export declare function passive(passive: boolean): {
    passive: boolean;
};

fxy060608's avatar
fxy060608 已提交
69 70
export declare const PLUS_RE: RegExp;

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

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

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

fxy060608's avatar
fxy060608 已提交
77 78
export declare const RESPONSIVE_MIN_WIDTH = 768;

fxy060608's avatar
fxy060608 已提交
79 80 81
declare function scrollTo_2(scrollTop: number | string, duration: number): void;
export { scrollTo_2 as scrollTo }

fxy060608's avatar
fxy060608 已提交
82 83 84 85 86 87
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 已提交
88 89
export declare function updateElementStyle(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;

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