Skip to content

Commit

Permalink
Add new callback
Browse files Browse the repository at this point in the history
  • Loading branch information
beachtom committed Jan 14, 2024
1 parent 8464124 commit ec84229
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/web-ifc-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export interface NewIfcModel {
authorization?: string;
}

export type ModelLoadCallback = (offset:number, size: number) => Uint8Array;

/** @ignore */
export function ms() {
return new Date().getTime();
Expand Down Expand Up @@ -293,7 +295,7 @@ export class IfcAPI {
* @param settings Settings for loading the model @see LoaderSettings
* @returns ModelID or -1 if model fails to open
*/
OpenModelFromCallback(callback: (offset:number, size: number) => Uint8Array, settings?: LoaderSettings): number {
OpenModelFromCallback(callback: ModelLoadCallback , settings?: LoaderSettings): number {
let s = this.CreateSettings(settings);
let result = this.wasmModule.OpenModel(s, (destPtr: number, offsetInSrc: number, destSize: number) => {
let data = callback(offsetInSrc,destSize);
Expand Down

0 comments on commit ec84229

Please sign in to comment.