UNPKG

typesync

Version:

Install missing TypeScript typings for your dependencies.

162 lines (153 loc) 4.87 kB
//#region dist/.tsdown-types-es/globber.d.ts interface IGlobber { /** * Globs for directory names. * * @param root */ globDirs(this: void, root: string, patterns: Array<string>, ignore?: Array<string>): Promise<Array<string>>; } //#endregion //#region dist/.tsdown-types-es/workspace-resolver.d.ts interface IWorkspaceResolverService { /** * Reads, parses, and normalizes a workspaces configuration from the following files, in this order: * - `package.json` `workspaces` field, as an array of globs. * - `package.json` `workspaces` field, as an object with a `packages` field, which is an array of globs. * - `pnpm-workspace.yaml` `packages` field, as an array of globs. * * Path is relative to the current working directory. * Note that this returns a list of directories, not paths to the manifests themselves. */ getWorkspaces(this: void, packageJson: IPackageFile, root: string, globber: IGlobber, ignored: IWorkspacesArray): Promise<IWorkspacesArray>; } type IWorkspacesArray = Array<string>; interface IWorkspacesObject { packages?: IWorkspacesArray; } type NpmWorkspacesConfig = IWorkspacesArray; type YarnWorkspacesConfig = IWorkspacesArray | (IWorkspacesObject & { nohoist?: Array<string> }); type BunWorkspacesConfig = IWorkspacesArray; type IWorkspacesSection = NpmWorkspacesConfig | YarnWorkspacesConfig | BunWorkspacesConfig; //#endregion //#region dist/.tsdown-types-es/types.d.ts interface ITypeSyncer { sync(this: void, filePath: string, flags: ICLIArguments["flags"]): Promise<ISyncResult>; } interface ISyncOptions { /** * Ignore certain deps. */ ignoreDeps?: Array<IDependencySection>; /** * Ignore certain packages. */ ignorePackages?: Array<string>; /** * Skip resolution of certain projects in the workspace. */ ignoreProjects?: IWorkspacesArray; } interface IPackageFile { name?: string; dependencies?: IDependenciesSection; devDependencies?: IDependenciesSection; peerDependencies?: IDependenciesSection; optionalDependencies?: IDependenciesSection; workspaces?: IWorkspacesSection; [key: string]: unknown; } type IDependenciesSection = Record<string, string>; interface IPackageVersion { name: string; version: string; } interface IPackageTypingDescriptor { typingsName: string; codePackageName: string; typesPackageName: string; } interface ISyncedTypeDefinition extends IPackageTypingDescriptor { codePackageName: string; } interface ISyncResult { /** * The files that were synced. */ syncedFiles: Array<ISyncedFile>; } interface ISyncedFile { /** * The cwd-relative path to the synced file. */ filePath: string; /** * The package file that was synced. */ package: IPackageFile; /** * The new typings that were added. */ newTypings: Array<ISyncedTypeDefinition>; } declare enum IDependencySection { dev = "dev", deps = "deps", optional = "optional", peer = "peer", } interface ICLIArguments { flags: Record<string, boolean | string | undefined>; args: Array<string>; } //#endregion //#region dist/.tsdown-types-es/config-service.d.ts interface IConfigService { /** * Get typesync config. */ readConfig(this: void, filePath: string, flags: ICLIArguments["flags"]): Promise<ISyncOptions>; } declare function createConfigService(): IConfigService; //#endregion //#region dist/.tsdown-types-es/versioning.d.ts interface IPackageVersionInfo { version: string; containsInternalTypings: boolean; } //#endregion //#region dist/.tsdown-types-es/package-source.d.ts interface IPackageSource { /** * Fetches package info from an external source. * * @param packageName */ fetch(this: void, packageName: string): Promise<IPackageInfo | null>; } interface IPackageInfo { name: string; latestVersion: string; deprecated: boolean; versions: Array<IPackageVersionInfo>; } declare function createPackageSource(): IPackageSource; //#endregion //#region dist/.tsdown-types-es/package-json-file-service.d.ts interface IPackageJSONService { /** * Reads and parses JSON from the specified file. Path is relative to the current working directory. */ readPackageFile(this: void, filePath: string): Promise<IPackageFile>; /** * Writes the JSON to the specified file. */ writePackageFile(this: void, filePath: string, fileContents: IPackageFile): Promise<void>; } //#endregion //#region dist/.tsdown-types-es/type-syncer.d.ts declare function createTypeSyncer(packageJSONService: IPackageJSONService, workspaceResolverService: IWorkspaceResolverService, packageSource: IPackageSource, configService: IConfigService, globber: IGlobber): ITypeSyncer; //#endregion export { ICLIArguments, IConfigService, IDependenciesSection, IDependencySection, IPackageFile, IPackageInfo, IPackageSource, IPackageTypingDescriptor, IPackageVersion, ISyncOptions, ISyncResult, ISyncedFile, ISyncedTypeDefinition, ITypeSyncer, createConfigService, createPackageSource, createTypeSyncer };