{"version":3,"file":"types.cjs","names":[],"sources":["../src/FabricFile.ts"],"sourcesContent":["import type ts from 'typescript'\n\ntype ImportName =\n  | string\n  | Array<\n      | string\n      | {\n          propertyName: string\n          name?: string\n        }\n    >\n\nexport type FunctionNode = {\n  /**\n   * Name of the function.\n   */\n  name: string\n  /**\n   * Function parameters string.\n   * @example 'id: number, name: string'\n   */\n  params?: string\n  /**\n   * Include export keyword.\n   * @default false\n   */\n  export?: boolean\n  /**\n   * Include default keyword (for default exports).\n   * @default false\n   */\n  default?: boolean\n  /**\n   * Make the function async.\n   * @default false\n   */\n  async?: boolean\n  /**\n   * TypeScript generics string or array.\n   * @example 'T' or ['T', 'U extends string']\n   */\n  generics?: string | string[]\n  /**\n   * Return type string.\n   * @example 'User'\n   */\n  returnType?: string\n}\n\nexport type ConstNode = {\n  /**\n   * Name of the constant.\n   */\n  name: string\n  /**\n   * TypeScript type annotation string.\n   * @example 'string' or 'User[]'\n   */\n  type?: string\n  /**\n   * Include export keyword.\n   * @default false\n   */\n  export?: boolean\n  /**\n   * Use const assertion (`as const`).\n   * @default false\n   */\n  asConst?: boolean\n}\n\nexport type TypeNode = {\n  /**\n   * Name of the type alias (must start with a capital letter).\n   */\n  name: string\n  /**\n   * Include export keyword.\n   * @default false\n   */\n  export?: boolean\n}\n\nexport type Import = {\n  /**\n   * Import name to be used\n   * @example [\"useState\"]\n   * @example \"React\"\n   */\n  name: ImportName\n\n  /**\n   * Path for the import\n   * @example '@kubb/core'\n   */\n  path: string\n  /**\n   * Add type-only import prefix.\n   * - `true` generates `import type { Type } from './path'`\n   * - `false` generates `import { Type } from './path'`\n   * @default false\n   */\n  isTypeOnly?: boolean\n\n  /**\n   * Import entire module as namespace.\n   * - `true` generates `import * as Name from './path'`\n   * - `false` generates standard import\n   * @default false\n   */\n  isNameSpace?: boolean\n  /**\n   * When root is set it will get the path with relative getRelativePath(root, path).\n   */\n  root?: string\n}\n\nexport type Source = {\n  name?: string\n  value?: string\n  /**\n   * TypeScript AST nodes representing the source declarations.\n   * Populated when source is created from Function, Const, or Type components.\n   * Can be used as an alternative to `value` for programmatic AST manipulation.\n   */\n  nodes?: Array<ts.Node>\n  /**\n   * Make this source a type-only export.\n   * - `true` marks source as type export\n   * - `false` marks source as value export\n   * @default false\n   */\n  isTypeOnly?: boolean\n  /**\n   * Include export keyword in source.\n   * - `true` generates exportable const or type\n   * - `false` generates internal declaration\n   * @default false\n   */\n  isExportable?: boolean\n  /**\n   * Include in barrel file generation.\n   * - `true` adds to barrel exports\n   * - `false` excludes from barrel exports\n   * @default false\n   */\n  isIndexable?: boolean\n}\n\nexport type Export = {\n  /**\n   * Export name to be used.\n   * @example [\"useState\"]\n   * @example \"React\"\n   */\n  name?: string | Array<string>\n  /**\n   * Path for the import.\n   * @example '@kubb/core'\n   */\n  path: string\n  /**\n   * Add type-only export prefix.\n   * - `true` generates `export type { Type } from './path'`\n   * - `false` generates `export { Type } from './path'`\n   * @default false\n   */\n  isTypeOnly?: boolean\n  /**\n   * Export as aliased namespace.\n   * - `true` generates `export * as aliasName from './path'`\n   * - `false` generates standard export\n   * @default false\n   */\n  asAlias?: boolean\n}\n\nexport type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`\n\nexport type Mode = 'single' | 'split'\n\n/**\n * Name to be used to dynamically create the baseName(based on input.path)\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\nexport type BaseName = `${string}.${string}`\n\n/**\n * Path will be full qualified path to a specified file\n */\nexport type Path = string\n\nexport type File<TMeta extends object = object> = {\n  /**\n   * Name to be used to create the path\n   * Based on UNIX basename, `${name}.extname`\n   * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n   */\n  baseName: BaseName\n  /**\n   * Path will be full qualified path to a specified file\n   */\n  path: Path\n  sources: Array<Source>\n  imports: Array<Import>\n  exports: Array<Export>\n  /**\n   * Use extra meta, this is getting used to generate the barrel/index files.\n   */\n  meta?: TMeta\n  banner?: string\n  footer?: string\n}\n\nexport type ResolvedFile<TMeta extends object = object> = File<TMeta> & {\n  /**\n   * @default hash\n   */\n  id: string\n  /**\n   * Contains the first part of the baseName, generated based on baseName\n   * @link  https://nodejs.org/api/path.html#pathformatpathobject\n   */\n  name: string\n  extname: Extname\n  imports: Array<Import>\n  exports: Array<Export>\n}\n"],"mappings":""}