@gltf-transform/core
Version:
glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
39 lines (38 loc) • 1.32 kB
TypeScript
import { PlatformIO } from './platform-io.js';
/**
* *I/O service for [Deno](https://deno.land/).*
*
* The most common use of the I/O service is to read/write a {@link Document} with a given path.
* Methods are also available for converting in-memory representations of raw glTF files, both
* binary (*Uint8Array*) and JSON ({@link JSONDocument}).
*
* _*NOTICE:* Support for the Deno environment is currently experimental. See
* [glTF-Transform#457](https://github.com/donmccurdy/glTF-Transform/issues/457)._
*
* Usage:
*
* ```typescript
* import { DenoIO } from 'https://esm.sh/@gltf-transform/core';
* import * as path from 'https://deno.land/std/path/mod.ts';
*
* const io = new DenoIO(path);
*
* // Read.
* let document;
* document = io.read('model.glb'); // → Document
* document = io.readBinary(glb); // Uint8Array → Document
*
* // Write.
* const glb = io.writeBinary(document); // Document → Uint8Array
* ```
*
* @category I/O
*/
export declare class DenoIO extends PlatformIO {
private _path;
constructor(path: unknown);
protected readURI(uri: string, type: 'view'): Promise<Uint8Array>;
protected readURI(uri: string, type: 'text'): Promise<string>;
protected resolve(base: string, path: string): string;
protected dirname(uri: string): string;
}