import { CommonServerOptions, HtmlTagDescriptor, InlineConfig, Plugin } from "vite"; import { PowerhouseConfig } from "@powerhousedao/config"; //#region connect-utils/constants.d.ts declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES"; declare const IMPORT_SCRIPT_FILE = "external-packages.js"; declare const LOCAL_PACKAGE_ID = "ph:local-package"; declare const PH_DIR_NAME = ".ph"; //#endregion //#region connect-utils/types.d.ts type IConnectOptions = { mode: string; dirname: string; envDir?: string; powerhouseConfig?: PowerhouseConfig; watchTimeout?: number; }; type ConnectCommonOptions = { base?: string; mode?: string; configFile?: string; projectRoot?: string; viteConfigFile?: string; disableLocalPackage?: boolean; defaultDrivesUrl?: string[]; drivesPreserveStrategy?: "preserve-all" | "preserve-by-url-and-detach"; }; type ViteDevOptions = Pick & { force?: boolean; }; type ConnectStudioOptions = ConnectCommonOptions & { devServerOptions?: ViteDevOptions; printUrls?: boolean; bindCLIShortcuts?: boolean; }; type ConnectBuildOptions = ConnectCommonOptions & { outDir?: string; }; type ConnectPreviewOptions = ConnectCommonOptions & Omit & { outDir?: string; printUrls?: boolean; bindCLIShortcuts?: boolean; }; //#endregion //#region connect-utils/helpers.d.ts declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/"; declare function commonConnectOptionsToEnv(options: ConnectCommonOptions): void; declare function resolveViteConfigPath(options: Pick): string; declare function resolvePackage(packageName: string, root?: string): string; declare function resolveConnectPackageJson(root?: string): JSON | null; /** * Finds the dist dir of Connect on the local machine */ declare function resolveConnectBundle(root?: string): string; declare function resolveConnectPublicDir(root?: string): string; /** * Copies the Connect dist dir to the target path */ declare function copyConnect(sourcePath: string, targetPath: string): void; /** * Backs up the index.html file * * Needed when running the Connect Studio dev server on Windows */ declare function backupIndexHtml(appPath: string, restore?: boolean): void; declare function removeBase64EnvValues(appPath: string): void; declare function readJsonFile(filePath: string): PowerhouseConfig | null; /** * Takes a list of Powerhouse project packages and optionally local Powerhouse packages and outputs a js file which exports those packages for use in Connect Studio. */ declare function makeImportScriptFromPackages(args: { packages: string[]; importStyles?: boolean; localJsPath?: string; localCssPath?: string; }): string; declare function ensureNodeVersion(minVersion?: string): void; declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin; /** * Appends the contents to the tag of the index.html file */ declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise; /** * Prepends the contents to the tag of the index.html file */ declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise; declare function runTsc(outDir: string): void; declare function stripVersionFromPackage(packageName: string): string; //#endregion //#region connect-utils/vite-config.d.ts declare function getConnectHtmlTags(options?: { registryUrl?: string | null; injectTo?: HtmlTagDescriptor["injectTo"]; }): [{ readonly tag: "meta"; readonly attrs: { readonly "http-equiv": "Content-Security-Policy"; readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval' https://esm.sh${string}; worker-src 'self' blob:; object-src 'none'; base-uri 'self';`; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly property: "og:title"; readonly content: "Connect"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly property: "og:type"; readonly content: "website"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly property: "og:url"; readonly content: "https://apps.powerhouse.io/powerhouse/connect/"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly property: "og:description"; readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly property: "og:image"; readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly name: "twitter:card"; readonly content: "summary_large_image"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly name: "twitter:image"; readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly name: "twitter:title"; readonly content: "Connect"; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }, { readonly tag: "meta"; readonly attrs: { readonly name: "twitter:description"; readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation."; }; readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend"; }]; declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig; //#endregion //#region connect-utils/vite-plugins/ph-packages.d.ts type PhPackagesPluginOptions = { packages: string[]; projectRoot?: string; registryUrl?: string | null; }; declare function phPackagesPlugin(options: PhPackagesPluginOptions): Plugin; //#endregion export { ConnectBuildOptions, ConnectCommonOptions, ConnectPreviewOptions, ConnectStudioOptions, DEFAULT_CONNECT_OUTDIR, EXTERNAL_PACKAGES_IMPORT, IConnectOptions, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, PH_DIR_NAME, PhPackagesPluginOptions, ViteDevOptions, appendToHtmlHead, backupIndexHtml, commonConnectOptionsToEnv, copyConnect, ensureNodeVersion, getConnectBaseViteConfig, getConnectHtmlTags, makeImportScriptFromPackages, phPackagesPlugin, prependToHtmlHead, readJsonFile, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolvePackage, resolveViteConfigPath, runShellScriptPlugin, runTsc, stripVersionFromPackage }; //# sourceMappingURL=index.d.mts.map