From 3009ac708dca831179fc854c34cbd3012fdd5549 Mon Sep 17 00:00:00 2001 From: Jacob Bandes-Storch Date: Wed, 27 Sep 2023 11:33:11 -0700 Subject: [PATCH] Add includeTypedArrays option to generateTypeScript (#128) ### Public-Facing Changes Added an `includeTypedArrays` option to `generateTypeScript` to allow generating type definitions that include TypedArrays in addition to plain `number[]` arrays. ### Description Relates FG-4976 See also https://github.com/foxglove/studio/pull/6890 --- .github/workflows/ci.yml | 4 + .../exportTypeScriptSchemas.test.ts.snap | 44 ++++++++ internal/exportTypeScriptSchemas.ts | 15 ++- internal/generateTypeScript.test.ts | 100 ++++++++++++++++++ internal/generateTypeScript.ts | 37 ++++++- package.json | 2 +- schemas/typescript/ArrowPrimitive.ts | 1 + schemas/typescript/CameraCalibration.ts | 1 + schemas/typescript/CircleAnnotation.ts | 1 + schemas/typescript/Color.ts | 1 + schemas/typescript/CompressedImage.ts | 1 + schemas/typescript/CompressedVideo.ts | 1 + schemas/typescript/CubePrimitive.ts | 1 + schemas/typescript/CylinderPrimitive.ts | 1 + schemas/typescript/FrameTransform.ts | 1 + schemas/typescript/FrameTransforms.ts | 1 + schemas/typescript/GeoJSON.ts | 1 + schemas/typescript/Grid.ts | 1 + schemas/typescript/ImageAnnotations.ts | 1 + schemas/typescript/KeyValuePair.ts | 1 + schemas/typescript/LaserScan.ts | 1 + schemas/typescript/LinePrimitive.ts | 1 + schemas/typescript/LineType.ts | 1 + schemas/typescript/LocationFix.ts | 1 + schemas/typescript/Log.ts | 1 + schemas/typescript/LogLevel.ts | 1 + schemas/typescript/ModelPrimitive.ts | 1 + schemas/typescript/NumericType.ts | 1 + schemas/typescript/PackedElementField.ts | 1 + schemas/typescript/Point2.ts | 1 + schemas/typescript/Point3.ts | 1 + schemas/typescript/PointCloud.ts | 1 + schemas/typescript/PointsAnnotation.ts | 1 + schemas/typescript/PointsAnnotationType.ts | 1 + schemas/typescript/Pose.ts | 1 + schemas/typescript/PoseInFrame.ts | 1 + schemas/typescript/PosesInFrame.ts | 1 + schemas/typescript/PositionCovarianceType.ts | 1 + schemas/typescript/Quaternion.ts | 1 + schemas/typescript/RawImage.ts | 1 + schemas/typescript/SceneEntity.ts | 1 + schemas/typescript/SceneEntityDeletion.ts | 1 + schemas/typescript/SceneEntityDeletionType.ts | 1 + schemas/typescript/SceneUpdate.ts | 1 + schemas/typescript/SpherePrimitive.ts | 1 + schemas/typescript/TextAnnotation.ts | 1 + schemas/typescript/TextPrimitive.ts | 1 + schemas/typescript/TriangleListPrimitive.ts | 1 + schemas/typescript/Vector2.ts | 1 + schemas/typescript/Vector3.ts | 1 + 50 files changed, 239 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7fea42d..d4010b16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: rm Linux.flatc.binary.clang++-12.zip sudo mv flatc /usr/local/bin - uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-node@v3 with: node-version: 16.x @@ -69,6 +71,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Flatbuffer compiler run: | curl -LO https://github.com/google/flatbuffers/releases/download/v23.1.21/Linux.flatc.binary.clang++-12.zip diff --git a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap index a65eb81e..6ef1c5ef 100644 --- a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap +++ b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap @@ -3,6 +3,7 @@ exports[`exportTypeScriptSchemas exports schemas 1`] = ` Map { "ArrowPrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -29,6 +30,7 @@ export type ArrowPrimitive = { }; ", "CameraCalibration" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; @@ -109,6 +111,7 @@ export type CameraCalibration = { }; ", "CircleAnnotation" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; @@ -136,6 +139,7 @@ export type CircleAnnotation = { }; ", "Color" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A color in RGBA format */ export type Color = { @@ -153,6 +157,7 @@ export type Color = { }; ", "CompressedImage" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; @@ -176,6 +181,7 @@ export type CompressedImage = { }; ", "CompressedVideo" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; @@ -199,6 +205,7 @@ export type CompressedVideo = { }; ", "CylinderPrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -223,6 +230,7 @@ export type CylinderPrimitive = { }; ", "CubePrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -241,6 +249,7 @@ export type CubePrimitive = { }; ", "FrameTransform" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Quaternion } from "./Quaternion"; import { Time } from "./Time"; @@ -265,6 +274,7 @@ export type FrameTransform = { }; ", "FrameTransforms" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { FrameTransform } from "./FrameTransform"; @@ -275,6 +285,7 @@ export type FrameTransforms = { }; ", "GeoJSON" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** GeoJSON data for annotating maps */ export type GeoJSON = { @@ -283,6 +294,7 @@ export type GeoJSON = { }; ", "Grid" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { PackedElementField } from "./PackedElementField"; import { Pose } from "./Pose"; @@ -320,6 +332,7 @@ export type Grid = { }; ", "ImageAnnotations" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { CircleAnnotation } from "./CircleAnnotation"; import { PointsAnnotation } from "./PointsAnnotation"; @@ -338,6 +351,7 @@ export type ImageAnnotations = { }; ", "KeyValuePair" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A key with its associated value */ export type KeyValuePair = { @@ -349,6 +363,7 @@ export type KeyValuePair = { }; ", "LaserScan" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; @@ -378,6 +393,7 @@ export type LaserScan = { }; ", "LinePrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { LineType } from "./LineType"; @@ -416,6 +432,7 @@ export type LinePrimitive = { }; ", "LocationFix" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { PositionCovarianceType } from "./PositionCovarianceType"; import { Time } from "./Time"; @@ -445,6 +462,7 @@ export type LocationFix = { }; ", "Log" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { LogLevel } from "./LogLevel"; import { Time } from "./Time"; @@ -471,6 +489,7 @@ export type Log = { }; ", "SceneEntityDeletion" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { SceneEntityDeletionType } from "./SceneEntityDeletionType"; import { Time } from "./Time"; @@ -488,6 +507,7 @@ export type SceneEntityDeletion = { }; ", "SceneEntity" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { ArrowPrimitive } from "./ArrowPrimitive"; import { CubePrimitive } from "./CubePrimitive"; @@ -547,6 +567,7 @@ export type SceneEntity = { }; ", "SceneUpdate" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { SceneEntity } from "./SceneEntity"; import { SceneEntityDeletion } from "./SceneEntityDeletion"; @@ -561,6 +582,7 @@ export type SceneUpdate = { }; ", "ModelPrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -591,6 +613,7 @@ export type ModelPrimitive = { }; ", "PackedElementField" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { NumericType } from "./NumericType"; @@ -607,6 +630,7 @@ export type PackedElementField = { }; ", "Point2" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A point representing a position in 2D space */ export type Point2 = { @@ -618,6 +642,7 @@ export type Point2 = { }; ", "Point3" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A point representing a position in 3D space */ export type Point3 = { @@ -632,6 +657,7 @@ export type Point3 = { }; ", "PointCloud" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { PackedElementField } from "./PackedElementField"; import { Pose } from "./Pose"; @@ -659,6 +685,7 @@ export type PointCloud = { }; ", "PointsAnnotation" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; @@ -690,6 +717,7 @@ export type PointsAnnotation = { }; ", "Pose" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Quaternion } from "./Quaternion"; import { Vector3 } from "./Vector3"; @@ -704,6 +732,7 @@ export type Pose = { }; ", "PoseInFrame" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; @@ -721,6 +750,7 @@ export type PoseInFrame = { }; ", "PosesInFrame" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; @@ -738,6 +768,7 @@ export type PosesInFrame = { }; ", "Quaternion" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A [quaternion](https://eater.net/quaternions) representing a rotation in 3D space */ export type Quaternion = { @@ -755,6 +786,7 @@ export type Quaternion = { }; ", "RawImage" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; @@ -787,6 +819,7 @@ export type RawImage = { }; ", "SpherePrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -805,6 +838,7 @@ export type SpherePrimitive = { }; ", "TextAnnotation" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; @@ -832,6 +866,7 @@ export type TextAnnotation = { }; ", "TextPrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; @@ -858,6 +893,7 @@ export type TextPrimitive = { }; ", "TriangleListPrimitive" => "// Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point3 } from "./Point3"; @@ -886,6 +922,7 @@ export type TriangleListPrimitive = { }; ", "Vector2" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A vector in 2D space that represents a direction only */ export type Vector2 = { @@ -897,6 +934,7 @@ export type Vector2 = { }; ", "Vector3" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** A vector in 3D space that represents a direction only */ export type Vector3 = { @@ -911,6 +949,7 @@ export type Vector3 = { }; ", "LineType" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** An enumeration indicating how input points should be interpreted to create lines */ export enum LineType { @@ -925,6 +964,7 @@ export enum LineType { } ", "LogLevel" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** Log level */ export enum LogLevel { @@ -942,6 +982,7 @@ export enum LogLevel { } ", "SceneEntityDeletionType" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** An enumeration indicating which entities should match a SceneEntityDeletion command */ export enum SceneEntityDeletionType { @@ -953,6 +994,7 @@ export enum SceneEntityDeletionType { } ", "NumericType" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** Numeric type */ export enum NumericType { @@ -976,6 +1018,7 @@ export enum NumericType { } ", "PointsAnnotationType" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** Type of points annotation */ export enum PointsAnnotationType { @@ -995,6 +1038,7 @@ export enum PointsAnnotationType { } ", "PositionCovarianceType" => "// Generated by https://github.com/foxglove/schemas +// Options: {} /** Type of position covariance */ export enum PositionCovarianceType { diff --git a/internal/exportTypeScriptSchemas.ts b/internal/exportTypeScriptSchemas.ts index 552b37ea..5f6de5fd 100644 --- a/internal/exportTypeScriptSchemas.ts +++ b/internal/exportTypeScriptSchemas.ts @@ -1,4 +1,9 @@ -import { DURATION_TS, TIME_TS, generateTypeScript } from "./generateTypeScript"; +import { + DURATION_TS, + GenerateTypeScriptOptions, + TIME_TS, + generateTypeScript, +} from "./generateTypeScript"; import { foxgloveEnumSchemas, foxgloveMessageSchemas } from "./schemas"; /** @@ -6,15 +11,17 @@ import { foxgloveEnumSchemas, foxgloveMessageSchemas } from "./schemas"; * * @returns a map of file base name => schema source. */ -export function exportTypeScriptSchemas(): Map { +export function exportTypeScriptSchemas( + options: GenerateTypeScriptOptions = {}, +): Map { const schemas = new Map(); for (const schema of Object.values(foxgloveMessageSchemas)) { - schemas.set(schema.name, generateTypeScript(schema)); + schemas.set(schema.name, generateTypeScript(schema, options)); } for (const schema of Object.values(foxgloveEnumSchemas)) { - schemas.set(schema.name, generateTypeScript(schema)); + schemas.set(schema.name, generateTypeScript(schema, options)); } schemas.set("Duration", DURATION_TS); diff --git a/internal/generateTypeScript.test.ts b/internal/generateTypeScript.test.ts index 0c213f44..bab716de 100644 --- a/internal/generateTypeScript.test.ts +++ b/internal/generateTypeScript.test.ts @@ -5,6 +5,7 @@ describe("generateTypeScript", () => { it("generates .d.ts files", () => { expect(generateTypeScript(exampleEnum)).toMatchInlineSnapshot(` "// Generated by https://github.com/foxglove/schemas + // Options: {} /** An example enum */ export enum ExampleEnum { @@ -18,6 +19,7 @@ describe("generateTypeScript", () => { `); expect(generateTypeScript(exampleMessage)).toMatchInlineSnapshot(` "// Generated by https://github.com/foxglove/schemas + // Options: {} import { Duration } from "./Duration"; import { ExampleEnum } from "./ExampleEnum"; @@ -115,4 +117,102 @@ describe("generateTypeScript", () => { it("generates parseable .ts files", async () => { await expect(import("../schemas/typescript")).resolves.not.toThrow(); }); + + it("can include TypedArray types", () => { + expect(generateTypeScript(exampleMessage, { includeTypedArrays: true })).toMatchInlineSnapshot(` + "// Generated by https://github.com/foxglove/schemas + // Options: {"includeTypedArrays":true} + + import { Duration } from "./Duration"; + import { ExampleEnum } from "./ExampleEnum"; + import { NestedMessage } from "./NestedMessage"; + import { Time } from "./Time"; + + /** An example type */ + export type ExampleMessage = { + /** duration field */ + field_duration: Duration; + + /** time field */ + field_time: Time; + + /** boolean field */ + field_boolean: boolean; + + /** bytes field */ + field_bytes: Uint8Array; + + /** float64 field */ + field_float64: number; + + /** uint32 field */ + field_uint32: number; + + /** string field */ + field_string: string; + + /** duration array field */ + field_duration_array: Duration[]; + + /** time array field */ + field_time_array: Time[]; + + /** boolean array field */ + field_boolean_array: boolean[]; + + /** bytes array field */ + field_bytes_array: Uint8Array[]; + + /** float64 array field */ + field_float64_array: number[] | Float32Array | Float64Array; + + /** uint32 array field */ + field_uint32_array: number[] | Uint32Array; + + /** string array field */ + field_string_array: string[]; + + /** duration fixed-length array field */ + field_duration_fixed_array: [Duration, Duration, Duration]; + + /** time fixed-length array field */ + field_time_fixed_array: [Time, Time, Time]; + + /** boolean fixed-length array field */ + field_boolean_fixed_array: [boolean, boolean, boolean]; + + /** bytes fixed-length array field */ + field_bytes_fixed_array: [Uint8Array, Uint8Array, Uint8Array]; + + /** float64 fixed-length array field */ + field_float64_fixed_array: [number, number, number] | Float32Array | Float64Array; + + /** uint32 fixed-length array field */ + field_uint32_fixed_array: [number, number, number] | Uint32Array; + + /** string fixed-length array field */ + field_string_fixed_array: [string, string, string]; + + /** An enum field */ + field_enum: ExampleEnum; + + /** An enum array field */ + field_enum_array: ExampleEnum[]; + + /** A nested field */ + field_nested: NestedMessage; + + /** + * A nested array field + * With + * a + * very + * long + * description + */ + field_nested_array: NestedMessage[]; + }; + " + `); + }); }); diff --git a/internal/generateTypeScript.ts b/internal/generateTypeScript.ts index 80d6b90c..4634a154 100644 --- a/internal/generateTypeScript.ts +++ b/internal/generateTypeScript.ts @@ -14,6 +14,21 @@ function primitiveToTypeScript(type: Exclude(); let definition: string; @@ -74,6 +100,13 @@ export function generateTypeScript(schema: FoxgloveSchema): string { } else if (field.array != undefined) { fieldType = `${fieldType}[]`; } + if ( + field.array != undefined && + options.includeTypedArrays === true && + field.type.type === "primitive" + ) { + fieldType = [fieldType, ...primitiveToTypedArray(field.type.name)].join(" | "); + } let comment: string; const descriptionLines = field.description.trim().split("\n"); if (descriptionLines.length === 1) { @@ -92,7 +125,7 @@ export function generateTypeScript(schema: FoxgloveSchema): string { } const outputSections = [ - `// Generated by https://github.com/foxglove/schemas`, + `// Generated by https://github.com/foxglove/schemas\n// Options: ${JSON.stringify(options)}`, Array.from(imports) .sort() diff --git a/package.json b/package.json index 87098049..44f600c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@foxglove/schemas", - "version": "1.5.1", + "version": "1.6.0", "description": "Foxglove-defined message schemas for ROS, Protobuf, and JSON", "license": "MIT", "repository": { diff --git a/schemas/typescript/ArrowPrimitive.ts b/schemas/typescript/ArrowPrimitive.ts index c0ce7b8a..be59a7db 100644 --- a/schemas/typescript/ArrowPrimitive.ts +++ b/schemas/typescript/ArrowPrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/CameraCalibration.ts b/schemas/typescript/CameraCalibration.ts index cc7676f3..3666b4d5 100644 --- a/schemas/typescript/CameraCalibration.ts +++ b/schemas/typescript/CameraCalibration.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; diff --git a/schemas/typescript/CircleAnnotation.ts b/schemas/typescript/CircleAnnotation.ts index 0a16ef90..128c996f 100644 --- a/schemas/typescript/CircleAnnotation.ts +++ b/schemas/typescript/CircleAnnotation.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; diff --git a/schemas/typescript/Color.ts b/schemas/typescript/Color.ts index 3a9a201e..e64b5dc1 100644 --- a/schemas/typescript/Color.ts +++ b/schemas/typescript/Color.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A color in RGBA format */ export type Color = { diff --git a/schemas/typescript/CompressedImage.ts b/schemas/typescript/CompressedImage.ts index 86926158..eebc49ed 100644 --- a/schemas/typescript/CompressedImage.ts +++ b/schemas/typescript/CompressedImage.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; diff --git a/schemas/typescript/CompressedVideo.ts b/schemas/typescript/CompressedVideo.ts index bc3482aa..8e7032ff 100644 --- a/schemas/typescript/CompressedVideo.ts +++ b/schemas/typescript/CompressedVideo.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; diff --git a/schemas/typescript/CubePrimitive.ts b/schemas/typescript/CubePrimitive.ts index 9c507a6e..2fb7256b 100644 --- a/schemas/typescript/CubePrimitive.ts +++ b/schemas/typescript/CubePrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/CylinderPrimitive.ts b/schemas/typescript/CylinderPrimitive.ts index a688226c..15d5f1ba 100644 --- a/schemas/typescript/CylinderPrimitive.ts +++ b/schemas/typescript/CylinderPrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/FrameTransform.ts b/schemas/typescript/FrameTransform.ts index 449a64f5..b4b804f8 100644 --- a/schemas/typescript/FrameTransform.ts +++ b/schemas/typescript/FrameTransform.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Quaternion } from "./Quaternion"; import { Time } from "./Time"; diff --git a/schemas/typescript/FrameTransforms.ts b/schemas/typescript/FrameTransforms.ts index 1375202d..14e57c1d 100644 --- a/schemas/typescript/FrameTransforms.ts +++ b/schemas/typescript/FrameTransforms.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { FrameTransform } from "./FrameTransform"; diff --git a/schemas/typescript/GeoJSON.ts b/schemas/typescript/GeoJSON.ts index 1d6e4562..6c15e642 100644 --- a/schemas/typescript/GeoJSON.ts +++ b/schemas/typescript/GeoJSON.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** GeoJSON data for annotating maps */ export type GeoJSON = { diff --git a/schemas/typescript/Grid.ts b/schemas/typescript/Grid.ts index eb64846e..373f99d2 100644 --- a/schemas/typescript/Grid.ts +++ b/schemas/typescript/Grid.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { PackedElementField } from "./PackedElementField"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/ImageAnnotations.ts b/schemas/typescript/ImageAnnotations.ts index b0fddd99..a8fa017e 100644 --- a/schemas/typescript/ImageAnnotations.ts +++ b/schemas/typescript/ImageAnnotations.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { CircleAnnotation } from "./CircleAnnotation"; import { PointsAnnotation } from "./PointsAnnotation"; diff --git a/schemas/typescript/KeyValuePair.ts b/schemas/typescript/KeyValuePair.ts index 82660c24..0bb66402 100644 --- a/schemas/typescript/KeyValuePair.ts +++ b/schemas/typescript/KeyValuePair.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A key with its associated value */ export type KeyValuePair = { diff --git a/schemas/typescript/LaserScan.ts b/schemas/typescript/LaserScan.ts index 4a6757f5..5d9a6653 100644 --- a/schemas/typescript/LaserScan.ts +++ b/schemas/typescript/LaserScan.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; diff --git a/schemas/typescript/LinePrimitive.ts b/schemas/typescript/LinePrimitive.ts index 83e7b1dc..9a772e13 100644 --- a/schemas/typescript/LinePrimitive.ts +++ b/schemas/typescript/LinePrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { LineType } from "./LineType"; diff --git a/schemas/typescript/LineType.ts b/schemas/typescript/LineType.ts index c2416754..47bcbac7 100644 --- a/schemas/typescript/LineType.ts +++ b/schemas/typescript/LineType.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** An enumeration indicating how input points should be interpreted to create lines */ export enum LineType { diff --git a/schemas/typescript/LocationFix.ts b/schemas/typescript/LocationFix.ts index 27d2c97a..3f70af6c 100644 --- a/schemas/typescript/LocationFix.ts +++ b/schemas/typescript/LocationFix.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { PositionCovarianceType } from "./PositionCovarianceType"; import { Time } from "./Time"; diff --git a/schemas/typescript/Log.ts b/schemas/typescript/Log.ts index c1c9ee90..02901237 100644 --- a/schemas/typescript/Log.ts +++ b/schemas/typescript/Log.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { LogLevel } from "./LogLevel"; import { Time } from "./Time"; diff --git a/schemas/typescript/LogLevel.ts b/schemas/typescript/LogLevel.ts index 62073029..3d23493e 100644 --- a/schemas/typescript/LogLevel.ts +++ b/schemas/typescript/LogLevel.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** Log level */ export enum LogLevel { diff --git a/schemas/typescript/ModelPrimitive.ts b/schemas/typescript/ModelPrimitive.ts index e1fcfa18..9ecd1e0c 100644 --- a/schemas/typescript/ModelPrimitive.ts +++ b/schemas/typescript/ModelPrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/NumericType.ts b/schemas/typescript/NumericType.ts index f4208d43..78731b7d 100644 --- a/schemas/typescript/NumericType.ts +++ b/schemas/typescript/NumericType.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** Numeric type */ export enum NumericType { diff --git a/schemas/typescript/PackedElementField.ts b/schemas/typescript/PackedElementField.ts index 38d45e75..a9c335b6 100644 --- a/schemas/typescript/PackedElementField.ts +++ b/schemas/typescript/PackedElementField.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { NumericType } from "./NumericType"; diff --git a/schemas/typescript/Point2.ts b/schemas/typescript/Point2.ts index d2680307..ff785f1a 100644 --- a/schemas/typescript/Point2.ts +++ b/schemas/typescript/Point2.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A point representing a position in 2D space */ export type Point2 = { diff --git a/schemas/typescript/Point3.ts b/schemas/typescript/Point3.ts index d36a9313..fc44a1e3 100644 --- a/schemas/typescript/Point3.ts +++ b/schemas/typescript/Point3.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A point representing a position in 3D space */ export type Point3 = { diff --git a/schemas/typescript/PointCloud.ts b/schemas/typescript/PointCloud.ts index 65d98f23..c79308af 100644 --- a/schemas/typescript/PointCloud.ts +++ b/schemas/typescript/PointCloud.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { PackedElementField } from "./PackedElementField"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/PointsAnnotation.ts b/schemas/typescript/PointsAnnotation.ts index 5ecd426f..7c302474 100644 --- a/schemas/typescript/PointsAnnotation.ts +++ b/schemas/typescript/PointsAnnotation.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; diff --git a/schemas/typescript/PointsAnnotationType.ts b/schemas/typescript/PointsAnnotationType.ts index 6fabd638..0ffcb4e1 100644 --- a/schemas/typescript/PointsAnnotationType.ts +++ b/schemas/typescript/PointsAnnotationType.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** Type of points annotation */ export enum PointsAnnotationType { diff --git a/schemas/typescript/Pose.ts b/schemas/typescript/Pose.ts index 99900597..44a3d89b 100644 --- a/schemas/typescript/Pose.ts +++ b/schemas/typescript/Pose.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Quaternion } from "./Quaternion"; import { Vector3 } from "./Vector3"; diff --git a/schemas/typescript/PoseInFrame.ts b/schemas/typescript/PoseInFrame.ts index df582248..33291551 100644 --- a/schemas/typescript/PoseInFrame.ts +++ b/schemas/typescript/PoseInFrame.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; diff --git a/schemas/typescript/PosesInFrame.ts b/schemas/typescript/PosesInFrame.ts index 62adf658..8da708de 100644 --- a/schemas/typescript/PosesInFrame.ts +++ b/schemas/typescript/PosesInFrame.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Pose } from "./Pose"; import { Time } from "./Time"; diff --git a/schemas/typescript/PositionCovarianceType.ts b/schemas/typescript/PositionCovarianceType.ts index 83612f25..01ecc0d5 100644 --- a/schemas/typescript/PositionCovarianceType.ts +++ b/schemas/typescript/PositionCovarianceType.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** Type of position covariance */ export enum PositionCovarianceType { diff --git a/schemas/typescript/Quaternion.ts b/schemas/typescript/Quaternion.ts index 59857fcd..3b092de3 100644 --- a/schemas/typescript/Quaternion.ts +++ b/schemas/typescript/Quaternion.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A [quaternion](https://eater.net/quaternions) representing a rotation in 3D space */ export type Quaternion = { diff --git a/schemas/typescript/RawImage.ts b/schemas/typescript/RawImage.ts index f2401bbd..32b5a565 100644 --- a/schemas/typescript/RawImage.ts +++ b/schemas/typescript/RawImage.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Time } from "./Time"; diff --git a/schemas/typescript/SceneEntity.ts b/schemas/typescript/SceneEntity.ts index fddb4cfc..e5372c98 100644 --- a/schemas/typescript/SceneEntity.ts +++ b/schemas/typescript/SceneEntity.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { ArrowPrimitive } from "./ArrowPrimitive"; import { CubePrimitive } from "./CubePrimitive"; diff --git a/schemas/typescript/SceneEntityDeletion.ts b/schemas/typescript/SceneEntityDeletion.ts index f74f2a9a..59d436a8 100644 --- a/schemas/typescript/SceneEntityDeletion.ts +++ b/schemas/typescript/SceneEntityDeletion.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { SceneEntityDeletionType } from "./SceneEntityDeletionType"; import { Time } from "./Time"; diff --git a/schemas/typescript/SceneEntityDeletionType.ts b/schemas/typescript/SceneEntityDeletionType.ts index b95e5520..64933d42 100644 --- a/schemas/typescript/SceneEntityDeletionType.ts +++ b/schemas/typescript/SceneEntityDeletionType.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** An enumeration indicating which entities should match a SceneEntityDeletion command */ export enum SceneEntityDeletionType { diff --git a/schemas/typescript/SceneUpdate.ts b/schemas/typescript/SceneUpdate.ts index 8cb8ed1b..2cce95be 100644 --- a/schemas/typescript/SceneUpdate.ts +++ b/schemas/typescript/SceneUpdate.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { SceneEntity } from "./SceneEntity"; import { SceneEntityDeletion } from "./SceneEntityDeletion"; diff --git a/schemas/typescript/SpherePrimitive.ts b/schemas/typescript/SpherePrimitive.ts index c0a17781..16d8d1e3 100644 --- a/schemas/typescript/SpherePrimitive.ts +++ b/schemas/typescript/SpherePrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/TextAnnotation.ts b/schemas/typescript/TextAnnotation.ts index b406ed77..d5dc6bd3 100644 --- a/schemas/typescript/TextAnnotation.ts +++ b/schemas/typescript/TextAnnotation.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point2 } from "./Point2"; diff --git a/schemas/typescript/TextPrimitive.ts b/schemas/typescript/TextPrimitive.ts index 86cda9b3..69cfb788 100644 --- a/schemas/typescript/TextPrimitive.ts +++ b/schemas/typescript/TextPrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Pose } from "./Pose"; diff --git a/schemas/typescript/TriangleListPrimitive.ts b/schemas/typescript/TriangleListPrimitive.ts index ffa09b67..a01cabfe 100644 --- a/schemas/typescript/TriangleListPrimitive.ts +++ b/schemas/typescript/TriangleListPrimitive.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} import { Color } from "./Color"; import { Point3 } from "./Point3"; diff --git a/schemas/typescript/Vector2.ts b/schemas/typescript/Vector2.ts index bafc0bd3..c601ea9e 100644 --- a/schemas/typescript/Vector2.ts +++ b/schemas/typescript/Vector2.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A vector in 2D space that represents a direction only */ export type Vector2 = { diff --git a/schemas/typescript/Vector3.ts b/schemas/typescript/Vector3.ts index cfef80d3..24a46c50 100644 --- a/schemas/typescript/Vector3.ts +++ b/schemas/typescript/Vector3.ts @@ -1,4 +1,5 @@ // Generated by https://github.com/foxglove/schemas +// Options: {} /** A vector in 3D space that represents a direction only */ export type Vector3 = {