import { Plugin, PluginServiceApi } from '@cloudbase/framework-core'; import { BuildResult } from '@cloudbase/framework-core/src/types'; import { StaticBuilder } from '@cloudbase/static-builder'; import { ZipBuilder } from './zip-builder'; declare const DEFAULT_INPUTS: { outputPath: string; cloudPath: string; ignore: string[]; commands: { install: string; }; }; declare enum PAYMODE { POSTPAID = "postpaid", PREPAYMENT = "prepayment" } /** * 导出接口用于生成 JSON Schema 来进行智能提示 */ export interface IFrameworkPluginWebsiteInputs { /** * 安装命令,如`npm install`,没有可不传 * * @default npm install --prefer-offline --no-audit --progress=false * @deprecated 此配置将被废弃,请使用新的配置 commands.install 代替 */ installCommand?: string; /** * 构建命令,如`npm run build`,没有可不传 * * @deprecated 此配置将被废弃,请使用新的配置 commands.build 代替 */ buildCommand?: string; /** * 网站静态文件的路径 * * @default dist */ outputPath?: string; /** * 静态资源部署到云开发环境的路径,默认为根目录。 * * @default / */ cloudPath?: string; /** * 静态资源部署时忽略的文件路径,支持通配符 * * @default [".git", ".github", "node_modules", "cloudbaserc.js"] */ ignore?: string[]; /** * 环境变量键值对,会被注入到静态网站根目录下的 `/cloudbaseenv.json` * */ envVariables?: Record; /** * 自定义命令 * * @default { build: "npm run build" } */ commands?: Record; /** * Http 访问服务触发路径,没有可不填 */ httpPath?: string; } type ResolvedInputs = typeof DEFAULT_INPUTS & IFrameworkPluginWebsiteInputs; declare class WebsitePlugin extends Plugin { name: string; api: PluginServiceApi; inputs: IFrameworkPluginWebsiteInputs; protected builder: StaticBuilder; protected zipBuilder: ZipBuilder; protected resolvedInputs: ResolvedInputs; protected buildOutput: BuildResult; protected env?: { PayMode: PAYMODE; EnvChannel: string; EnvType: string; }; protected website: any; constructor(name: string, api: PluginServiceApi, inputs: IFrameworkPluginWebsiteInputs); /** * 初始化 */ init(): Promise; /** * 编译为 SAM 模板 */ compile(): Promise<{ EnvType: string; Resources: { [x: string]: { Type: string; Properties: { HttpPath: string; Description: string; CodeUri: string; DeployPath: string; } | { HttpPath?: undefined; Description: string; CodeUri: string; DeployPath: string; }; }; }; EntryPoint: { Label: string; EntryType: string; HttpEntryPath: string; }[]; }>; getStaticResourceSam(name: string, description: string, codeUri: string, deployPath: string): { [x: string]: { Type: string; Properties: { HttpPath: string; Description: string; CodeUri: string; DeployPath: string; } | { HttpPath?: undefined; Description: string; CodeUri: string; DeployPath: string; }; }; }; upload(): Promise<({ src: string; cloudPath: string; } & { codeUri: any; })[]>; /** * 删除资源 */ remove(): Promise; /** * 生成代码 */ genCode(): Promise; /** * 构建 */ build(): Promise; /** * 部署 */ deploy(): Promise; /** * 执行本地命令 */ run(params: { runCommandKey: string; }): Promise; /** * 安装依赖 */ installPackage(): Promise; /** * 确保非BAAS环境开启了按量付费 */ ensurePostPay(): Promise; /** * 查询静态托管信息 */ fetchHostingInfo(): Promise; fetchServiceDomain(): Promise; } export declare const plugin: typeof WebsitePlugin; export {}; //# sourceMappingURL=index.d.ts.map