Skip to content

Commit

Permalink
Use Prettier to reformat TypeScript type definitions as well
Browse files Browse the repository at this point in the history
  • Loading branch information
zeux committed Jul 1, 2024
1 parent 086b416 commit 1567d9c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ format:
clang-format -i $(LIBRARY_SOURCES) $(DEMO_SOURCES) $(GLTFPACK_SOURCES)

formatjs:
prettier -w js/*.js gltf/*.js demo/*.html
prettier -w js/*.js gltf/*.js demo/*.html js/*.ts

js: js/meshopt_decoder.js js/meshopt_decoder.module.js js/meshopt_encoder.js js/meshopt_encoder.module.js js/meshopt_simplifier.js js/meshopt_simplifier.module.js

Expand Down
18 changes: 9 additions & 9 deletions js/meshopt_decoder.module.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// This file is part of meshoptimizer library and is distributed under the terms of MIT License.
// Copyright (C) 2016-2024, by Arseny Kapoulkine ([email protected])
export const MeshoptDecoder: {
supported: boolean;
ready: Promise<void>;

decodeVertexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, filter?: string) => void;
decodeIndexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeIndexSequence: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
supported: boolean;
ready: Promise<void>;

decodeGltfBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string) => void;
decodeVertexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, filter?: string) => void;
decodeIndexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeIndexSequence: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;

useWorkers: (count: number) => void;
decodeGltfBufferAsync: (count: number, size: number, source: Uint8Array, mode: string, filter?: string) => Promise<Uint8Array>;
decodeGltfBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string) => void;

useWorkers: (count: number) => void;
decodeGltfBufferAsync: (count: number, size: number, source: Uint8Array, mode: string, filter?: string) => Promise<Uint8Array>;
};
24 changes: 12 additions & 12 deletions js/meshopt_encoder.module.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// This file is part of meshoptimizer library and is distributed under the terms of MIT License.
// Copyright (C) 2016-2024, by Arseny Kapoulkine ([email protected])
export const MeshoptEncoder: {
supported: boolean;
ready: Promise<void>;
supported: boolean;
ready: Promise<void>;

reorderMesh: (indices: Uint32Array, triangles: boolean, optsize: boolean) => [Uint32Array, number];
reorderPoints: (positions: Float32Array, positions_stride: number) => Uint32Array;

encodeVertexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
encodeIndexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
encodeIndexSequence: (source: Uint8Array, count: number, size: number) => Uint8Array;
reorderMesh: (indices: Uint32Array, triangles: boolean, optsize: boolean) => [Uint32Array, number];
reorderPoints: (positions: Float32Array, positions_stride: number) => Uint32Array;

encodeGltfBuffer: (source: Uint8Array, count: number, size: number, mode: string) => Uint8Array;
encodeVertexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
encodeIndexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
encodeIndexSequence: (source: Uint8Array, count: number, size: number) => Uint8Array;

encodeFilterOct: (source: Float32Array, count: number, stride: number, bits: number) => Uint8Array;
encodeFilterQuat: (source: Float32Array, count: number, stride: number, bits: number) => Uint8Array;
encodeFilterExp: (source: Float32Array, count: number, stride: number, bits: number, mode?: "Separate" | "SharedVector" | "SharedComponent") => Uint8Array;
encodeGltfBuffer: (source: Uint8Array, count: number, size: number, mode: string) => Uint8Array;

encodeFilterOct: (source: Float32Array, count: number, stride: number, bits: number) => Uint8Array;
encodeFilterQuat: (source: Float32Array, count: number, stride: number, bits: number) => Uint8Array;
encodeFilterExp: (source: Float32Array, count: number, stride: number, bits: number, mode?: 'Separate' | 'SharedVector' | 'SharedComponent') => Uint8Array;
};
22 changes: 11 additions & 11 deletions js/meshopt_simplifier.module.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// This file is part of meshoptimizer library and is distributed under the terms of MIT License.
// Copyright (C) 2016-2024, by Arseny Kapoulkine ([email protected])
export type Flags = "LockBorder" | "Sparse" | "ErrorAbsolute";
export type Flags = 'LockBorder' | 'Sparse' | 'ErrorAbsolute';

export const MeshoptSimplifier: {
supported: boolean;
ready: Promise<void>;
supported: boolean;
ready: Promise<void>;

useExperimentalFeatures: boolean;
useExperimentalFeatures: boolean;

compactMesh: (indices: Uint32Array) => [Uint32Array, number];
compactMesh: (indices: Uint32Array) => [Uint32Array, number];

simplify: (indices: Uint32Array, vertex_positions: Float32Array, vertex_positions_stride: number, target_index_count: number, target_error: number, flags?: Flags[]) => [Uint32Array, number];
simplify: (indices: Uint32Array, vertex_positions: Float32Array, vertex_positions_stride: number, target_index_count: number, target_error: number, flags?: Flags[]) => [Uint32Array, number];

// Experimental; requires useExperimentalFeatures to be set to true
simplifyWithAttributes: (indices: Uint32Array, vertex_positions: Float32Array, vertex_positions_stride: number, vertex_attributes: Float32Array, vertex_attributes_stride: number, attribute_weights: number[], vertex_lock: boolean[] | null, target_index_count: number, target_error: number, flags?: Flags[]) => [Uint32Array, number];
// Experimental; requires useExperimentalFeatures to be set to true
simplifyWithAttributes: (indices: Uint32Array, vertex_positions: Float32Array, vertex_positions_stride: number, vertex_attributes: Float32Array, vertex_attributes_stride: number, attribute_weights: number[], vertex_lock: boolean[] | null, target_index_count: number, target_error: number, flags?: Flags[]) => [Uint32Array, number];

getScale: (vertex_positions: Float32Array, vertex_positions_stride: number) => number;
getScale: (vertex_positions: Float32Array, vertex_positions_stride: number) => number;

// Experimental; requires useExperimentalFeatures to be set to true
simplifyPoints: (vertex_positions: Float32Array, vertex_positions_stride: number, target_vertex_count: number, vertex_colors?: Float32Array, vertex_colors_stride?: number, color_weight?: number) => Uint32Array;
// Experimental; requires useExperimentalFeatures to be set to true
simplifyPoints: (vertex_positions: Float32Array, vertex_positions_stride: number, target_vertex_count: number, vertex_colors?: Float32Array, vertex_colors_stride?: number, color_weight?: number) => Uint32Array;
};

0 comments on commit 1567d9c

Please sign in to comment.