Add standalone type definitions
This commit is contained in:
36
src/types/Map.ts
Normal file
36
src/types/Map.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Grid } from "./Grid";
|
||||
|
||||
export type BaseMap = {
|
||||
id: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
grid: Grid;
|
||||
width: number;
|
||||
height: number;
|
||||
type: string;
|
||||
lastModified: number;
|
||||
created: number;
|
||||
showGrid: boolean;
|
||||
snapToGrid: boolean;
|
||||
};
|
||||
|
||||
export type DefaultMap = BaseMap & {
|
||||
type: "default";
|
||||
key: string;
|
||||
};
|
||||
|
||||
export type FileMapResolutions = {
|
||||
low?: string;
|
||||
medium?: string;
|
||||
high?: string;
|
||||
ultra?: string;
|
||||
};
|
||||
|
||||
export type FileMap = BaseMap & {
|
||||
type: "file";
|
||||
file: string;
|
||||
resolutions: FileMapResolutions;
|
||||
thumbnail: string;
|
||||
};
|
||||
|
||||
export type Map = DefaultMap | FileMap;
|
||||
Reference in New Issue
Block a user