uni-shared.d.ts 3.3 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

fxy060608's avatar
fxy060608 已提交
13 14
export declare function createRpx2Unit(unit: string, unitRatio: number, unitPrecision: number): (val: string) => string;

fxy060608's avatar
fxy060608 已提交
15 16 17 18 19
export declare function debounce(fn: Function, delay: number): {
    (this: any): void;
    cancel(): void;
};

fxy060608's avatar
fxy060608 已提交
20 21 22 23 24 25 26 27 28 29 30
/**
 * 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 已提交
31 32 33 34 35 36
export declare const defaultRpx2Unit: {
    unit: string;
    unitRatio: number;
    unitPrecision: number;
};

D
DCloud_LXH 已提交
37 38 39 40 41
export declare function formatDateTime({ date, mode }: {
    date?: Date | undefined;
    mode?: string | undefined;
}): string;

fxy060608's avatar
fxy060608 已提交
42 43
export declare function getEnvLocale(): string;

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

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

fxy060608's avatar
fxy060608 已提交
48 49 50 51 52 53 54 55
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 已提交
56 57
export declare function normalizeDataset(el: Element): any;

fxy060608's avatar
fxy060608 已提交
58 59 60 61 62 63 64
export declare function normalizeTarget(el: HTMLElement): {
    id: string;
    dataset: any;
    offsetTop: number;
    offsetLeft: number;
};

fxy060608's avatar
fxy060608 已提交
65 66
export declare const ON_REACH_BOTTOM_DISTANCE = 50;

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

fxy060608's avatar
fxy060608 已提交
69 70 71 72 73 74 75 76 77
/**
 * 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 已提交
78 79 80 81
export declare function passive(passive: boolean): {
    passive: boolean;
};

fxy060608's avatar
fxy060608 已提交
82 83
export declare const PLUS_RE: RegExp;

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

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

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

fxy060608's avatar
fxy060608 已提交
90 91
export declare const RESPONSIVE_MIN_WIDTH = 768;

fxy060608's avatar
fxy060608 已提交
92 93
export declare type Rpx2UnitOptions = typeof defaultRpx2Unit;

fxy060608's avatar
fxy060608 已提交
94 95
export declare const sanitise: (val: unknown) => any;

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

fxy060608's avatar
fxy060608 已提交
99 100 101 102 103 104
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 已提交
105 106 107 108 109 110
export declare const UNI_SSR = "__uniSSR";

export declare const UNI_SSR_DATA = "data";

export declare const UNI_SSR_GLOBAL_DATA = "globalData";

fxy060608's avatar
fxy060608 已提交
111 112
export declare const UNI_SSR_STORE = "store";

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

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