import { Scene } from "@aura3d/scene";
import { AnimationClip, Skeleton, type Mat4, type Quat, type SerializedAnimationClip, type SkinningPalette, type Vec3 } from "@aura3d/animation";
import type { AssetLoadRequest, AssetLoader } from "./AssetLoader";
import { type GLTFExtensionSupportEvaluation } from "./GLTFExtensionSupport";
import type { LoadContext } from "./LoadContext";
export interface GLTFMeshAsset {
    readonly name: string;
    readonly sourceMeshIndex: number;
    readonly primitiveIndex: number;
    readonly topology: "triangles" | "lines" | "points";
    readonly geometry: GLTFGeometryAsset;
    readonly positions: readonly (readonly [number, number, number])[];
    readonly normals: readonly (readonly [number, number, number])[];
    readonly texcoords: readonly (readonly [number, number])[];
    readonly texcoordSets: readonly (readonly (readonly [number, number])[])[];
    readonly tangents: readonly (readonly [number, number, number, number])[];
    readonly colors: readonly (readonly [number, number, number, number])[];
    readonly joints: readonly (readonly [number, number, number, number])[];
    readonly weights: readonly (readonly [number, number, number, number])[];
    readonly morphTargets: readonly GLTFMorphTargetAsset[];
    readonly morphWeights: readonly number[];
    readonly indices?: readonly number[];
    readonly material: string;
    readonly materialIndex?: number;
    readonly materialVariants: readonly GLTFMaterialVariantMappingAsset[];
    readonly skinIndex?: number;
}
export interface GLTFRuntimeMaterialContract {
    readonly skinned?: boolean;
    readonly instanced?: boolean;
}
export interface GLTFRuntimeMaterialKey {
    readonly material: string;
    readonly contract: GLTFRuntimeMaterialContract;
}
export interface GLTFMorphTargetAsset {
    readonly positions: readonly (readonly [number, number, number])[];
    readonly normals: readonly (readonly [number, number, number])[];
    readonly tangents: readonly (readonly [number, number, number])[];
}
export interface GLTFGeometryAsset {
    readonly vertexCount: number;
    readonly indexCount: number;
    readonly bounds: {
        readonly min: readonly [number, number, number];
        readonly max: readonly [number, number, number];
    };
}
export interface GLTFLoaderDiagnostics {
    readonly schemaVersion: "gltf-loader-diagnostics";
    readonly features: readonly string[];
    readonly extensionsUsed: readonly string[];
    readonly extensionsRequired: readonly string[];
    readonly unsupportedExtensions: readonly string[];
    readonly extensionSupport?: GLTFExtensionSupportEvaluation;
    readonly unsupportedFeatures: readonly string[];
    readonly meshCount: number;
    readonly primitiveCount: number;
    readonly vertexCount: number;
    readonly indexCount: number;
    readonly materialCount: number;
    readonly textureCount: number;
    readonly imageCount: number;
    readonly animationCount: number;
    readonly skinCount: number;
    readonly morphTargetCount: number;
    readonly materialFeatures: readonly string[];
    readonly textureSlots: readonly string[];
    readonly compression: {
        readonly draco: boolean;
        readonly meshopt: boolean;
        readonly ktx2Basis: boolean;
    };
    readonly loadProfile?: GLTFLoaderLoadProfileDiagnostics;
}
export interface GLTFLoaderLoadProfileDiagnostics {
    readonly schemaVersion: "gltf-loader-load-profile";
    readonly documentBytes: number;
    readonly binaryChunkBytes: number;
    readonly bufferBytes: number;
    readonly imageBytes: number;
    readonly embeddedImageBytes: number;
    readonly externalImageCount: number;
    readonly bufferViewImageCount: number;
    readonly accessorReadCount: number;
    readonly uniqueAccessorReadCount: number;
    readonly accessorCacheHitCount: number;
    readonly accessorRowsRead: number;
    readonly accessorValuesRead: number;
    readonly accessorReadMs: number;
    readonly dataViewCacheEntries: number;
    readonly largestAccessors: readonly GLTFAccessorLoadProfileEntry[];
}
export interface GLTFAccessorLoadProfileEntry {
    readonly accessorIndex: number;
    readonly count: number;
    readonly type: "SCALAR" | "VEC2" | "VEC3" | "VEC4" | "MAT4";
    readonly componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126;
    readonly componentCount: number;
    readonly byteLength: number;
    readonly bufferView?: number;
}
export interface GLTFAsset {
    readonly url: string;
    readonly disposed: boolean;
    readonly loaderDiagnostics: GLTFLoaderDiagnostics;
    readonly images: readonly GLTFImageAsset[];
    readonly textures: readonly GLTFTextureAsset[];
    readonly materials: readonly GLTFMaterialAsset[];
    readonly materialVariants: readonly GLTFMaterialVariantAsset[];
    readonly scenes: readonly GLTFSceneAsset[];
    readonly defaultScene: number;
    readonly meshes: readonly GLTFMeshAsset[];
    readonly cameras: readonly GLTFCameraAsset[];
    readonly lights: readonly GLTFLightAsset[];
    readonly skins: readonly GLTFSkinAsset[];
    readonly animations: readonly AnimationClip[];
    createScene(options?: GLTFSceneCreateOptions): Scene;
    toJSON(): SerializedGLTFAsset;
}
export interface GLTFSceneCreateOptions {
    readonly materialVariant?: string;
    readonly sceneIndex?: number;
    readonly sceneName?: string;
}
export interface GLTFImageAsset {
    readonly name: string;
    readonly uri?: string;
    readonly mimeType?: string;
    readonly data?: ArrayBuffer;
}
export interface GLTFTextureAsset {
    readonly name: string;
    readonly source: number;
    readonly sampler?: number;
    readonly samplerDescriptor?: GLTFSamplerAsset;
}
export interface GLTFSceneAsset {
    readonly name: string;
    readonly nodeIndices: readonly number[];
}
export interface GLTFSamplerAsset {
    readonly minFilter: "nearest" | "linear" | "nearest-mipmap-nearest" | "linear-mipmap-nearest" | "nearest-mipmap-linear" | "linear-mipmap-linear";
    readonly magFilter: "nearest" | "linear";
    readonly addressU: "clamp-to-edge" | "repeat" | "mirror-repeat";
    readonly addressV: "clamp-to-edge" | "repeat" | "mirror-repeat";
}
export interface GLTFMaterialAsset {
    readonly name: string;
    readonly unlit: boolean;
    readonly baseColorFactor: readonly [number, number, number, number];
    readonly baseColorTexture?: GLTFResolvedTextureInfo;
    readonly metallicFactor: number;
    readonly roughnessFactor: number;
    readonly metallicRoughnessTexture?: GLTFResolvedTextureInfo;
    readonly normalTexture?: GLTFResolvedTextureInfo & {
        readonly scale: number;
    };
    readonly occlusionTexture?: GLTFResolvedTextureInfo & {
        readonly strength: number;
    };
    readonly emissiveTexture?: GLTFResolvedTextureInfo;
    readonly emissiveFactor: readonly [number, number, number];
    readonly emissiveStrength: number;
    readonly clearcoat?: GLTFClearcoatMaterialExtension;
    readonly transmission?: GLTFTransmissionMaterialExtension;
    readonly diffuseTransmission?: GLTFDiffuseTransmissionMaterialExtension;
    readonly volume?: GLTFVolumeMaterialExtension;
    readonly ior?: number;
    readonly specular?: GLTFSpecularMaterialExtension;
    readonly pbrSpecularGlossiness?: GLTFPBRSpecularGlossinessMaterialExtension;
    readonly sheen?: GLTFSheenMaterialExtension;
    readonly anisotropy?: GLTFAnisotropyMaterialExtension;
    readonly iridescence?: GLTFIridescenceMaterialExtension;
    readonly dispersion?: number;
    readonly alphaMode: "OPAQUE" | "MASK" | "BLEND";
    readonly alphaCutoff: number;
    readonly doubleSided: boolean;
}
export interface GLTFMaterialVariantAsset {
    readonly name: string;
}
export interface GLTFMaterialVariantMappingAsset {
    readonly variantIndex: number;
    readonly variant: string;
    readonly materialIndex: number;
    readonly material: string;
}
export interface GLTFClearcoatMaterialExtension {
    readonly factor: number;
    readonly texture?: GLTFResolvedTextureInfo;
    readonly roughnessFactor: number;
    readonly roughnessTexture?: GLTFResolvedTextureInfo;
    readonly normalTexture?: GLTFResolvedTextureInfo & {
        readonly scale: number;
    };
}
export interface GLTFTransmissionMaterialExtension {
    readonly factor: number;
    readonly texture?: GLTFResolvedTextureInfo;
}
export interface GLTFDiffuseTransmissionMaterialExtension {
    readonly factor: number;
    readonly texture?: GLTFResolvedTextureInfo;
    readonly colorFactor: readonly [number, number, number];
    readonly colorTexture?: GLTFResolvedTextureInfo;
}
export interface GLTFVolumeMaterialExtension {
    readonly thicknessFactor: number;
    readonly thicknessTexture?: GLTFResolvedTextureInfo;
    readonly attenuationDistance: number;
    readonly attenuationColor: readonly [number, number, number];
}
export interface GLTFSpecularMaterialExtension {
    readonly factor: number;
    readonly texture?: GLTFResolvedTextureInfo;
    readonly colorFactor: readonly [number, number, number];
    readonly colorTexture?: GLTFResolvedTextureInfo;
}
export interface GLTFPBRSpecularGlossinessMaterialExtension {
    readonly diffuseFactor: readonly [number, number, number, number];
    readonly diffuseTexture?: GLTFResolvedTextureInfo;
    readonly specularFactor: readonly [number, number, number];
    readonly glossinessFactor: number;
    readonly specularGlossinessTexture?: GLTFResolvedTextureInfo;
}
export interface GLTFSheenMaterialExtension {
    readonly colorFactor: readonly [number, number, number];
    readonly colorTexture?: GLTFResolvedTextureInfo;
    readonly roughnessFactor: number;
    readonly roughnessTexture?: GLTFResolvedTextureInfo;
}
export interface GLTFAnisotropyMaterialExtension {
    readonly strength: number;
    readonly rotation: number;
    readonly texture?: GLTFResolvedTextureInfo;
}
export interface GLTFIridescenceMaterialExtension {
    readonly factor: number;
    readonly texture?: GLTFResolvedTextureInfo;
    readonly ior: number;
    readonly thicknessMinimum: number;
    readonly thicknessMaximum: number;
    readonly thicknessTexture?: GLTFResolvedTextureInfo;
}
export interface GLTFLightAsset {
    readonly name: string;
    readonly type: "directional" | "point" | "spot";
    readonly color: readonly [number, number, number];
    readonly intensity: number;
    readonly range?: number;
    readonly spot?: {
        readonly innerConeAngle: number;
        readonly outerConeAngle: number;
    };
}
export interface GLTFCameraAsset {
    readonly name: string;
    readonly type: "perspective" | "orthographic";
    readonly perspective?: {
        readonly aspectRatio: number;
        readonly yfov: number;
        readonly znear: number;
        readonly zfar: number;
    };
    readonly orthographic?: {
        readonly xmag: number;
        readonly ymag: number;
        readonly znear: number;
        readonly zfar: number;
    };
}
export interface GLTFResolvedTextureInfo {
    readonly texture: number;
    readonly image: number;
    readonly texCoord: number;
    readonly transform?: GLTFResolvedTextureTransform;
}
export interface GLTFResolvedTextureTransform {
    readonly offset: readonly [number, number];
    readonly scale: readonly [number, number];
    readonly rotation: number;
}
export interface GLTFSkinAsset {
    readonly name: string;
    readonly joints: readonly number[];
    readonly jointNames: readonly string[];
    readonly inverseBindMatrices: readonly Mat4[];
    readonly skeletonRoot?: number;
    readonly skeleton: Skeleton;
    readonly jointBindMatrices: readonly Mat4[];
    readonly skinningPalette?: SkinningPalette;
}
export interface SerializedGLTFAsset {
    readonly url: string;
    readonly loaderDiagnostics: GLTFLoaderDiagnostics;
    readonly images: readonly {
        readonly name: string;
        readonly uri?: string;
        readonly mimeType?: string;
        readonly byteLength?: number;
    }[];
    readonly textures: readonly GLTFTextureAsset[];
    readonly materials: readonly GLTFMaterialAsset[];
    readonly materialVariants: readonly GLTFMaterialVariantAsset[];
    readonly scenes: readonly GLTFSceneAsset[];
    readonly defaultScene: number;
    readonly meshes: readonly GLTFMeshAsset[];
    readonly cameras: readonly GLTFCameraAsset[];
    readonly lights: readonly GLTFLightAsset[];
    readonly skins: readonly {
        readonly name: string;
        readonly joints: readonly number[];
        readonly jointNames: readonly string[];
        readonly inverseBindMatrices: readonly Mat4[];
        readonly skeletonRoot?: number;
        readonly bones: readonly {
            readonly name: string;
            readonly parentIndex: number;
            readonly translation: Vec3;
            readonly rotation: Quat;
            readonly scale: Vec3;
            readonly inverseBindMatrix: Mat4;
        }[];
    }[];
    readonly animations: readonly SerializedAnimationClip[];
}
export interface GLTFMeshoptDecodeDescriptor {
    readonly bufferViewIndex: number;
    readonly byteStride: number;
    readonly count: number;
    readonly mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES";
    readonly filter: "NONE" | "OCTAHEDRAL" | "QUATERNION" | "EXPONENTIAL" | "COLOR";
}
export type GLTFMeshoptDecoder = (source: Uint8Array, descriptor: GLTFMeshoptDecodeDescriptor) => ArrayBuffer | Uint8Array | Promise<ArrayBuffer | Uint8Array>;
export interface GLTFDracoDecodeDescriptor {
    readonly meshIndex: number;
    readonly primitiveIndex: number;
    readonly bufferViewIndex: number;
    readonly attributes: Readonly<Record<string, number>>;
}
export interface GLTFDracoDecodedPrimitive {
    readonly attributes: Readonly<Record<string, readonly (readonly number[])[]>>;
    readonly indices?: readonly number[];
}
export type GLTFDracoDecoder = (source: Uint8Array, descriptor: GLTFDracoDecodeDescriptor) => GLTFDracoDecodedPrimitive | Promise<GLTFDracoDecodedPrimitive>;
export interface GLTFLoaderOptions {
    readonly meshoptDecoder?: GLTFMeshoptDecoder;
    readonly dracoDecoder?: GLTFDracoDecoder;
}
export declare class GLTFLoader implements AssetLoader<GLTFAsset> {
    private readonly options;
    readonly type = "gltf";
    constructor(options?: GLTFLoaderOptions);
    canLoad(request: AssetLoadRequest): boolean;
    load(request: AssetLoadRequest, context: LoadContext): Promise<GLTFAsset>;
    dispose(asset: GLTFAsset): void;
}
export declare function gltfRuntimeMaterialKey(material: string, contract: GLTFRuntimeMaterialContract): string;
export declare function parseGLTFRuntimeMaterialKey(key: string): GLTFRuntimeMaterialKey;
//# sourceMappingURL=GLTFLoader.d.ts.map