Skip to content

Commit

Permalink
feat: export type CanvasSourceSpecification
Browse files Browse the repository at this point in the history
  • Loading branch information
fxnm authored Dec 22, 2024
1 parent 595654a commit ac1741b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/source/canvas_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import ValidationError from '../style-spec/error/validation_error';
import type {Map} from '../ui/map';
import type Dispatcher from '../util/dispatcher';
import type {Evented} from '../util/evented';

export type CanvasSourceSpecification = {
["type"]: 'canvas';
["coordinates"]: [[number, number], [number, number], [number, number], [number, number]];
["animate"]?: boolean;
["canvas"]: string | HTMLCanvasElement;
};
import type {CanvasSourceSpecification} from '../style-spec/types';

/**
* Options to add a canvas source type to the map.
Expand Down
8 changes: 8 additions & 0 deletions src/style-spec/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ export type ModelSourceSpecification = {
"tiles"?: Array<string>
}

export type CanvasSourceSpecification = {
["type"]: 'canvas';
["coordinates"]: [[number, number], [number, number], [number, number], [number, number]];
["animate"]?: boolean;
["canvas"]: string | HTMLCanvasElement;
};

export type SourceSpecification =
| VectorSourceSpecification
| RasterSourceSpecification
Expand All @@ -401,6 +408,7 @@ export type SourceSpecification =
| VideoSourceSpecification
| ImageSourceSpecification
| ModelSourceSpecification
| CanvasSourceSpecification;

export type ModelSpecification = string;

Expand Down

0 comments on commit ac1741b

Please sign in to comment.