@hanzogui/static
v8.3.5 · types/index.d.ts · 48 values · 23 types
Exports
attrStr
valueexport declare const attrStr: (attr?: ExtractedAttr) => string | t.JSXIdentifier;
@hanzogui/static/types/extractor/extractHelpers.d.ts
cacheDir
valueexport declare const cacheDir: string | undefined;
@hanzogui/static/types/constants.d.ts
CacheObject
typeexport interface CacheObject { [key: string]: any; }
@hanzogui/static/types/types.d.ts
checkDeps
valueexport declare function checkDeps(root: string): Promise<void>;
@hanzogui/static/types/checkDeps.d.ts
ClassNameObject
typeexport type ClassNameObject = t.StringLiteral | t.Expression;
@hanzogui/static/types/types.d.ts
ClassNameToStyleObj
typeexport type ClassNameToStyleObj = { [key: string]: StyleObject; };
@hanzogui/static/types/types.d.ts
clearFormatCache
valueexport declare function clearFormatCache(): void;
@hanzogui/static/types/extractor/detectModuleFormat.d.ts
concatClassName
valuenext - take objects: { _shorthand: 'postfix' }
export declare function concatClassName(...args: any[]): any;
@hanzogui/static/types/extractor/concatClassName.d.ts
createExtractor
valueexport declare function createExtractor({ logger, platform }?: ExtractorOptions): { options: { logger: import("../types.ts").Logger; }; cleanupBeforeExit: typeof cleanupBeforeExit; loadGui: (props: GuiOptions) => Promise<GuiProjectInfo | null>; loadGuiSync: (props: GuiOptions) => GuiProjectInfo | null; getGui(): import("@hanzogui/web").GuiInternalConfig | null | undefined; parseSync: (f: FileOrPath, props: ExtractorParseProps) => { styled: number; flattened: number; optimized: number; modified: number; found: number; } | null; parse: (f: FileOrPath, props: ExtractorParseProps) => Promise<{ styled: number; flattened: number; optimized: number; modified: number; found: number; } | null>; };
@hanzogui/static/types/extractor/createExtractor.d.ts
createLogger
valueexport declare function createLogger(sourcePath: string, options: GuiOptions): (res: any) => void;
@hanzogui/static/types/extractor/createLogger.d.ts
CSS_FILE_NAME
valueexport declare const CSS_FILE_NAME = "__snack.css";
@hanzogui/static/types/constants.d.ts
DEFAULT_EXTRACT_PACKAGES
valueThe design-system allowlist an app can opt into. Not the default.
export declare const DEFAULT_EXTRACT_PACKAGES: string[];
@hanzogui/static/types/extractor/extractablePath.d.ts
DEPENDENCY_TYPE
valueexport declare enum DEPENDENCY_TYPE { dependencies = "dependencies", devDependencies = "devDependencies", optionalDependencies = "optionalDependencies", peerDependencies = "peerDependencies", resolutions = "resolutions" }
@hanzogui/static/types/checkDeps.d.ts
detectModuleFormat
valueexport declare function detectModuleFormat(filePath: string): ModuleFormat;
@hanzogui/static/types/extractor/detectModuleFormat.d.ts
esbuildWatchFiles
valueexport declare function esbuildWatchFiles(entry: string, onChanged: () => void): Promise<() => void>;
@hanzogui/static/types/extractor/loadGui.d.ts
esbundleGuiConfig
valueexport declare function esbundleGuiConfig(props: Props, platform: GuiPlatform, aliases?: Record<string, string>): Promise<esbuild.BuildResult<{ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both'; legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external'; sourceRoot?: string; sourcesContent?: boolean; format?: esbuild.Format; globalName?: string; target?: string | string[]; supported?: Record<string, boolean>; platform?: esbuild.Platform; mangleProps?: RegExp; reserveProps?: RegExp; mangleQuoted?: boolean; mangleCache?: Record<string, string | false>; drop?: esbuild.Drop[]; dropLabels?: string[]; minify?: boolean; minifyWhitespace?: boolean; minifyIdentifiers?: boolean; minifySyntax?: boolean; lineLimit?: number; charset?: esbuild.Charset; treeShaking?: boolean; ignoreAnnotations?: boolean; jsx?: 'transform' | 'preserve' | 'automatic'; jsxFactory?: string; jsxFragment?: string; jsxImportSource?: string; jsxDev?: boolean; jsxSideEffects?: boolean; define?: { [key: string]: string; }; pure?: string[]; keepNames?: boolean; …
@hanzogui/static/types/extractor/bundle.d.ts
ExtractedAttr
typeexport type ExtractedAttr = ExtractedAttrAttr | ExtractedTernaryAttr | ExtractedAttrStyle;
@hanzogui/static/types/types.d.ts
ExtractedAttrAttr
typeexport type ExtractedAttrAttr = { type: 'attr'; value: t.JSXAttribute | t.JSXSpreadAttribute; extraClassNames?: string; };
@hanzogui/static/types/types.d.ts
ExtractedAttrStyle
typeexport type ExtractedAttrStyle = { type: 'style'; value: ViewStyle & PseudoStyles; attr?: t.JSXAttribute | t.JSXSpreadAttribute; name?: string; extraClassNames?: string; };
@hanzogui/static/types/types.d.ts
ExtractedResponse
typeexport type ExtractedResponse = { js: string | Buffer; styles: string; stylesPath?: string; ast: t.File; map: any; stats: { styled: number; flattened: number; optimized: number; found: number; }; };
@hanzogui/static/types/extractor/extractToClassNames.d.ts
ExtractedTernaryAttr
typeexport type ExtractedTernaryAttr = { type: 'ternary'; value: Ternary; };
@hanzogui/static/types/types.d.ts
ExtractorOptions
typeexport type ExtractorOptions = { logger?: Logger; platform?: GuiPlatform; };
@hanzogui/static/types/types.d.ts
ExtractorParseProps
typeexport type ExtractorParseProps = Omit<GuiOptionsWithFileInfo, 'allLoadedComponents'> & { platform: GuiPlatform; shouldPrintDebug?: boolean | 'verbose'; onExtractTag: (props: ExtractTagProps) => void; getFlattenedNode?: (props: { isTextView: boolean; tag: string; }) => string; extractStyledDefinitions?: boolean; onStyledDefinitionRule?: (identifier: string, rules: string[]) => void; };
@hanzogui/static/types/types.d.ts
ExtractTagProps
typeexport type ExtractTagProps = { parserProps: GuiOptionsWithFileInfo; attrs: ExtractedAttr[]; node: t.JSXOpeningElement; attemptEval: (exprNode: t.Node, evalFn?: ((node: t.Node) => any) | undefined) => any; flatNodeName?: string; jsxPath: NodePath<t.JSXElement>; programPath: NodePath<t.Program>; originalNodeName: string; lineNumbers: string; filePath: string; completeProps: Record<string, any>; staticConfig: StaticConfig; config: GuiConfig; };
@hanzogui/static/types/types.d.ts
extractToClassNames
valueexport declare function extractToClassNames({ extractor, source, sourcePath, options, shouldPrintDebug, }: ExtractToClassNamesProps): Promise<ExtractedResponse | null>;
@hanzogui/static/types/extractor/extractToClassNames.d.ts
ExtractToClassNamesProps
typeexport type ExtractToClassNamesProps = { extractor: Extractor; source: string | Buffer; sourcePath?: string; options: GuiOptions; shouldPrintDebug: boolean | 'verbose'; };
@hanzogui/static/types/extractor/extractToClassNames.d.ts
extractToNative
valueexport declare function extractToNative(sourceFileName: string, sourceCode: string, options: GuiOptions): FileResult;
@hanzogui/static/types/extractor/extractToNative.d.ts
FAILED_EVAL
valueexport declare const FAILED_EVAL: unique symbol;
@hanzogui/static/types/constants.d.ts
findComponentName
valueexport declare function findComponentName(scope: any): string | undefined;
@hanzogui/static/types/extractor/extractHelpers.d.ts
generateThemesAndLog
valueexport declare const generateThemesAndLog: (options: GuiOptions, force?: boolean) => Promise<void>;
@hanzogui/static/types/extractor/loadGui.d.ts
getBabelParseDefinition
valueexport declare function getBabelParseDefinition(options: GuiOptions): { name: string; visitor: { Program: { enter(this: any, root: any): void; }; }; };
@hanzogui/static/types/extractor/extractToNative.d.ts
getBabelPlugin
valueexport declare function getBabelPlugin(): (api: import("@babel/core").PluginAPI, options: GuiOptions, dirname: string) => import("@babel/core").PluginObject<any>;
@hanzogui/static/types/extractor/extractToNative.d.ts
getNameToPaths
valueexport declare const getNameToPaths: () => {};
@hanzogui/static/types/registerRequire.d.ts
getOptions
valueexport declare function getOptions({ root, tsconfigPath, hanzoguiOptions, host, debug, }?: Partial<CLIUserOptions>): Promise<CLIResolvedOptions>;
@hanzogui/static/types/extractor/loadGui.d.ts
getPragmaOptions
valueexport declare function getPragmaOptions({ source, path }: { source: string; path: string; }): { shouldPrintDebug: "verbose" | boolean; shouldDisable: boolean; };
@hanzogui/static/types/getPragmaOptions.d.ts
getValidComponent
valueexport declare function getValidComponent(props: GuiOptionsWithFileInfo, moduleName: string, componentName: string): false | { staticConfig: import("@hanzogui/web").StaticConfig; } | null;
@hanzogui/static/types/extractor/extractHelpers.d.ts
getValidComponentsPaths
valueexport declare const getValidComponentsPaths: { (...args: any[]): any; cache: Map<any, any>; };
@hanzogui/static/types/extractor/extractHelpers.d.ts
getValidImport
valueexport declare const getValidImport: (props: GuiOptionsWithFileInfo, moduleName: string, componentName?: string) => { staticConfig: import("@hanzogui/web").StaticConfig; } | null;
@hanzogui/static/types/extractor/extractHelpers.d.ts
GuiBuildOptions
typeexport interface GuiBuildOptions { /** * module paths you want to compile with hanzogui (for example ['hanzogui']) * */ components?: string[]; /** * relative path to your hanzogui.config.ts */ config?: string; /** * Use the new ThemeBuilder in `@hanzogui/create-theme` to create beautiful theme sets, * see docs at https://hanzogui.dev/docs/guides/theme-builder * This helps you automate generating the build themes typescript file which loads fastere * and has smaller bundle size. */ themeBuilder?: { input: string; output: string; }; /** * Emit design system related CSS during build step for usage with frameworks */ outputCSS?: string | null | false; /** * (Experimental) outputs themes using CSS Nesting https://caniuse.com/css-nesting * Which can cut them in half due to no media query duplication. */ useCSSNesting?: boolean; /** * Gui can follow imports and evaluate them when parsing styles, leading to * higher percent of flattened / optimized views. We normalize this to be the * full path of the file, always ending in ".js". * …
@hanzogui/types/types/index.d.ts
GuiOptions
typeexport interface GuiOptions extends GuiBuildOptions { platform?: 'native' | 'web'; }
@hanzogui/types/types/index.d.ts
GuiOptionsWithFileInfo
typeexport type GuiOptionsWithFileInfo = GuiOptions & { sourcePath?: string; allLoadedComponents: LoadedComponents[]; };
@hanzogui/static/types/types.d.ts
GuiPlatform
typeexport type GuiPlatform = 'native' | 'web';
@hanzogui/static/types/types.d.ts
GuiProjectInfo
typeexport type { GuiProjectInfo };
@hanzogui/static/types/extractor/loadGui.d.ts
installedPackageOf
valueThe installed package a file belongs to, or '' when the file is app or workspace source. Reads the LAST `node_modules/` segment, so a nested install and pnpm's `.pnpm/<pkg>@<ver>/node_modules/<pkg>` both name the package that actually owns the file.
export declare function installedPackageOf(sourcePath: string): string;
@hanzogui/static/types/extractor/extractablePath.d.ts
isComponentPackage
valueexport declare const isComponentPackage: (props: GuiOptionsWithFileInfo, srcName: string) => any;
@hanzogui/static/types/extractor/extractHelpers.d.ts
isExtractable
valueMay the compiler read styles out of this file?
export declare function isExtractable(sourcePath: string, extractPackages?: string[]): boolean;
@hanzogui/static/types/extractor/extractablePath.d.ts
isInsideComponentPackage
valueexport declare const isInsideComponentPackage: (props: GuiOptionsWithFileInfo, moduleName: string) => any;
@hanzogui/static/types/extractor/extractHelpers.d.ts
isPresent
valueexport declare function isPresent<T extends object>(input: null | void | undefined | T): input is T;
@hanzogui/static/types/extractor/extractHelpers.d.ts
isSimpleSpread
valueexport declare function isSimpleSpread(node: t.JSXSpreadAttribute): boolean;
@hanzogui/static/types/extractor/extractHelpers.d.ts
isValidImport
valueexport declare const isValidImport: (props: GuiOptionsWithFileInfo, moduleName: string, componentName?: string) => any;
@hanzogui/static/types/extractor/extractHelpers.d.ts
isValidModule
valueexport declare const isValidModule: (props: GuiOptionsWithFileInfo, moduleName: string) => { isLocal: boolean; isValid: any; };
@hanzogui/static/types/extractor/extractHelpers.d.ts
isValidThemeHook
valueexport declare function isValidThemeHook(props: GuiOptionsWithFileInfo, jsxPath: NodePath<t.JSXElement>, n: t.MemberExpression, sourcePath?: string): boolean;
@hanzogui/static/types/extractor/extractHelpers.d.ts
literalToAst
valueexport declare function literalToAst(literal: any): t.Expression;
@hanzogui/static/types/extractor/literalToAst.d.ts
loadGui
valueexport declare function loadGui(propsIn: Partial<GuiOptions>): Promise<GuiProjectInfo | null>;
@hanzogui/static/types/extractor/loadGui.d.ts
loadGuiBuildConfigAsync
valueLoad hanzogui.build.ts config using esbuild-wasm transform Uses WASM to avoid native esbuild service lifecycle issues (EPIPE errors)
export declare function loadGuiBuildConfigAsync(hanzoguiOptions: Partial<GuiOptions> | undefined): Promise<GuiOptions>;
@hanzogui/static/types/extractor/loadGui.d.ts
loadGuiBuildConfigSync
value@deprecated Use loadGuiBuildConfigAsync instead to avoid EPIPE errors
export declare function loadGuiBuildConfigSync(hanzoguiOptions: Partial<GuiOptions> | undefined): GuiOptions;
@hanzogui/static/types/extractor/loadGui.d.ts
loadGuiSync
valueexport declare function loadGuiSync({ forceExports, cacheKey, ...propsIn }: Partial<GuiOptions> & { forceExports?: boolean; cacheKey?: string; }): GuiProjectInfo;
@hanzogui/static/types/extractor/loadGui.d.ts
Logger
typeexport interface Logger { info(msg: string, options?: LogOptions): void; warn(msg: string, options?: LogOptions): void; error(msg: string, options?: LogOptions): void; }
@hanzogui/static/types/types.d.ts
LogOptions
typeexport interface LogOptions { clear?: boolean; timestamp?: boolean; error?: Error | null; }
@hanzogui/static/types/types.d.ts
MEDIA_SEP
valueexport declare const MEDIA_SEP = "_";
@hanzogui/static/types/constants.d.ts
objToStr
valueexport declare const objToStr: (obj: any, spacer?: string) => any;
@hanzogui/static/types/extractor/extractHelpers.d.ts
Options
typeexport type Options = { depType?: readonly `${DEPENDENCY_TYPE}`[]; fix?: boolean; ignoreDep?: readonly string[]; ignoreDepPattern?: readonly string[]; ignorePackage?: readonly string[]; ignorePackagePattern?: readonly string[]; ignorePath?: readonly string[]; ignorePathPattern?: readonly string[]; };
@hanzogui/static/types/checkDeps.d.ts
PluginContext
typeexport interface PluginContext { write: (path: string, rules: { [key: string]: string; }) => any; }
@hanzogui/static/types/types.d.ts
registerRequire
valueexport declare function registerRequire(platform: GuiPlatform, { proxyWormImports }?: { proxyWormImports: boolean; }): { hanzoguiRequire: (this: any, path: string) => any; unregister: () => void; };
@hanzogui/static/types/registerRequire.d.ts
resolveWebOrNativeSpecificEntry
valueexport declare function resolveWebOrNativeSpecificEntry(entry: string, platform?: string): string;
@hanzogui/static/types/extractor/loadGui.d.ts
setRequireResult
valueexport declare function setRequireResult(name: string, result: any): void;
@hanzogui/static/types/registerRequire.d.ts
SHOULD_DEBUG
valueexport declare const SHOULD_DEBUG: boolean | undefined;
@hanzogui/static/types/constants.d.ts
StyleObject
typeexport type StyleObject = [ property: string, value: any, identifier: string, pseudo: 'hover' | 'focus' | 'focus-visible' | 'focus-within' | 'active' | undefined, rules: string[] ];
@hanzogui/helpers/types/types.d.ts
Ternary
typeexport interface Ternary { test: t.Expression; remove: Function; consequent: object | null; alternate: object | null; fontFamily?: string; inlineMediaQuery?: string; }
@hanzogui/static/types/types.d.ts
ternaryStr
valueexport declare const ternaryStr: (x: Ternary) => string;
@hanzogui/static/types/extractor/extractHelpers.d.ts
watchGuiConfig
valueexport declare function watchGuiConfig(hanzoguiOptions: GuiOptions): Promise<{ dispose(): void; } | undefined>;
@hanzogui/static/types/extractor/watchGuiConfig.d.ts