import type { CompressTags } from '../../image/compress.js'; import type { MipmapTags } from '../../image/mipmap.js'; import type { JsonTags } from '../../json/index.js'; import type { PixiManifestTags } from '../../manifest/pixiManifest.js'; import type { SpineAtlasCompressTags } from '../../spine/spineAtlasCompress.js'; import type { SpineAtlasMipmapTags } from '../../spine/spineAtlasMipmap.js'; import type { TexturePackerTags } from '../../texture-packer/texturePacker.js'; import type { TexturePackerCacheBusterTags } from '../../texture-packer/texturePackerCacheBuster.js'; import type { TexturePackerCompressTags } from '../../texture-packer/texturePackerCompress.js'; import type { SignedFontTags } from '../../webfont/sdf.js'; import type { WebfontTags } from '../../webfont/webfont.js'; import type { Asset } from '../Asset.js'; import type { PipeSystem } from './PipeSystem.js'; export type NotNull = T extends null | undefined ? never : T; type Primitive = undefined | null | boolean | string | number | Function; export type DeepRequired = T extends Primitive ? NotNull : { [P in keyof T]-?: T[P] extends Array ? Array> : T[P] extends ReadonlyArray ? DeepRequired : DeepRequired; }; export interface PluginOptions { } export type Tags = CompressTags | MipmapTags | JsonTags | PixiManifestTags | SpineAtlasCompressTags | SpineAtlasMipmapTags | TexturePackerTags | TexturePackerCacheBusterTags | TexturePackerCompressTags | WebfontTags | SignedFontTags | (string & NonNullable); export interface AssetPipe, TAGS extends Tags = string, INTERNAL_TAGS extends Tags = string> { /** Whether the process runs on a folder */ folder?: boolean; /** Name of the plugin used to tell the manifest parsers which one to use */ name: string; /** Default options for the plugin */ defaultOptions: OPTIONS; /** Tags that can be used to control the plugin */ tags?: Record; /** * Any tags here will not be placed in the manifest data. */ internalTags?: Record; /** * Called once at the start. * @param asser - the root asset * @param processor - Processor that called the function. */ start?(asset: Asset, options: DeepRequired, pipeSystem: PipeSystem): Promise; /** * Returns a boolean on whether or not the process should affect this tree. * @param asset - Tree to be tested. * @returns By defaults returns false. */ test?(asset: Asset, options: DeepRequired): boolean; /** * * @param tree - * @param processor - Processor that called the function. */ transform?(asset: Asset, options: DeepRequired, pipeSystem: PipeSystem): Promise; /** * Called once after tree has been processed. * @param asset - the root asset * @param processor - Processor that called the function. */ finish?(asset: Asset, options: DeepRequired, pipeSystem: PipeSystem): Promise; } export {};