Files
你的名字 4c2f5c69a1 chore: update node_modules with new binary files and dependencies
- Add new binary files for nodemon, onnxruntime-web, and xenova/transformers
- Update various JavaScript and TypeScript files in node_modules
- Remove unused files and dependencies
- Add new test fixtures and documentation files
2025-07-18 08:41:48 +08:00

44 lines
1.3 KiB
TypeScript

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {InferenceSession, OnnxValue} from 'onnxruntime-common';
type SessionOptions = InferenceSession.SessionOptions;
type FeedsType = {
[name: string]: OnnxValue;
};
type FetchesType = {
[name: string]: OnnxValue|null;
};
type ReturnType = {
[name: string]: OnnxValue;
};
type RunOptions = InferenceSession.RunOptions;
/**
* Binding exports a simple synchronized inference session object wrap.
*/
export declare namespace Binding {
export interface InferenceSession {
loadModel(modelPath: string, options: SessionOptions): void;
loadModel(buffer: ArrayBuffer, byteOffset: number, byteLength: number, options: SessionOptions): void;
readonly inputNames: string[];
readonly outputNames: string[];
run(feeds: FeedsType, fetches: FetchesType, options: RunOptions): ReturnType;
}
export interface InferenceSessionConstructor {
new(): InferenceSession;
}
}
// export native binding
export const binding =
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
require(`../bin/napi-v3/${process.platform}/${process.arch}/onnxruntime_binding.node`) as
// eslint-disable-next-line @typescript-eslint/naming-convention
{InferenceSession: Binding.InferenceSessionConstructor};