uni-ticket-system/node_modules/@dcloudio/uni-cli-shared/dist/mp/template.d.ts

91 lines
2.9 KiB
TypeScript
Raw Normal View History

2023-12-05 02:11:10 +00:00
import type { EmittedAsset } from 'rollup';
import type { ElementNode } from '@vue/compiler-core';
type LazyElementFn = (node: ElementNode, context: {
isMiniProgramComponent(name: string): 'plugin' | 'component' | 'dynamicLib' | undefined;
}) => {
[name: string]: {
name: 'on' | 'bind';
arg: string[];
}[] | true;
} | boolean;
export interface MiniProgramCompilerOptions {
/**
* render editor ready switch change
*/
lazyElement?: {
[name: string]: {
name: 'on' | 'bind';
arg: string[];
}[] | true;
} | LazyElementFn;
event?: {
key?: boolean;
format?(name: string, opts: {
isCatch?: boolean;
isCapture?: boolean;
isComponent?: boolean;
}): string;
};
class: {
/**
* array
*/
array: boolean;
};
slot: {
/**
* $slots.default 访
*/
$slots?: boolean;
/**
*
*/
fallbackContent?: boolean;
/**
*
*/
dynamicSlotNames?: boolean;
};
filter?: {
lang: string;
};
component?: {
/**
* wxcomponents
*/
dir?: string;
/**
* hidden v-show
*/
vShow?: string;
/**
* setData properties mp-weixinmp-qqmp-alipay
*/
getPropertySync?: boolean;
/**
* wx-btn => weixin-btn ( wx )
*/
normalizeName?: (name: string) => string;
/**
* classstyle
*/
mergeVirtualHostAttributes?: boolean;
};
directive: string;
emitFile?: (emittedFile: EmittedAsset) => string;
}
export interface MiniProgramFilterOptions {
id: string;
type: string;
name: string;
src?: string;
code: string;
}
type GenFilterFn = (filter: MiniProgramFilterOptions, filename: string) => string | void;
export declare function findMiniProgramTemplateFiles(genFilter?: GenFilterFn): Record<string, string>;
export declare function clearMiniProgramTemplateFiles(): void;
export declare function addMiniProgramTemplateFile(filename: string, code: string): void;
export declare function clearMiniProgramTemplateFilter(filename: string): void;
export declare function addMiniProgramTemplateFilter(filename: string, filter: MiniProgramFilterOptions): void;
export {};