nanogl-gltf
Version:
53 lines (52 loc) • 1.84 kB
TypeScript
import { IExtensionFactory, IExtensionInstance } from './IExtension';
import GltfLoader from '../io/GltfLoader';
/**
* This class provides functionalities for managing a list of extensions
*/
export declare class ExtensionList {
/**
* Map of extensions by name
*/
_map: Record<string, IExtensionInstance>;
/**
* Array of extensions
*/
_list: IExtensionInstance[];
/**
* Add an extension to the list, will throw if extension already exists
* @param ext Extension to add
*/
addExtension(ext: IExtensionInstance): void;
/**
* Sort extensions _list by priority, highest priority first
*/
sort(): void;
/**
* Check if this list contains a list of given extensions
* @param used List of used but not necessary extensions, will only warn if missing
* @param required List of necessary extensions, will throw if missing
*/
validate(used?: string[], required?: string[]): void;
}
/**
* This class manages all the extensions activated for Gltf processing (like KHR_texture_transform, EXT_texture_webp, ...)
*/
declare class ExtensionsRegistry {
/**
* Map of extensions factories by name
*/
_extensionFactories: Record<string, IExtensionFactory>;
constructor();
/**
* Add an extension factory to the registry
* @param ext Extension factory to add to the registry
*/
addExtension(ext: IExtensionFactory): void;
/**
* Setup extensions for a given loader, will create extension instances from extension factories
* @param loader Loader to setup extensions for
* @param additionalExtensions Additional extensions not yet added in the registry
*/
setupExtensions(loader: GltfLoader, additionalExtensions?: IExtensionFactory[]): void;
}
export default ExtensionsRegistry;