Internal change

PiperOrigin-RevId: 513992315
This commit is contained in:
MediaPipe Team 2023-03-03 20:52:01 -08:00 committed by Copybara-Service
parent 3d41eabc2e
commit c98b4b6ec6

View File

@ -1123,6 +1123,18 @@ async function runScript(scriptUrl: string) {
} }
} }
/**
* Helper type macro for use with createMediaPipeLib. Allows us to easily infer
* the type of a mixin-extended GraphRunner. Example usage:
* const GraphRunnerConstructor =
* SupportImage(SupportSerialization(GraphRunner));
* let mediaPipe: ReturnType<typeof GraphRunnerConstructor>;
* ...
* mediaPipe = await createMediaPipeLib(GraphRunnerConstructor, ...);
*/
// tslint:disable-next-line:no-any
export type ReturnType<T> = T extends (...args: unknown[]) => infer R ? R : any;
/** /**
* Global function to initialize Wasm blob and load runtime assets for a * Global function to initialize Wasm blob and load runtime assets for a
* specialized MediaPipe library. This allows us to create a requested * specialized MediaPipe library. This allows us to create a requested