-
Notifications
You must be signed in to change notification settings - Fork 18
/
e-shape-deserializers.ts
37 lines (32 loc) · 1.08 KB
/
e-shape-deserializers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (C) 2019 Toshiba Corporation
* SPDX-License-Identifier: Apache-2.0
*/
import { DDiagramSerializedItem } from "../d-diagram-serialized";
import { EShape } from "./e-shape";
import { EShapeResourceManagerDeserialization } from "./e-shape-resource-manager-deserialization";
import { EShapeUuidMapping } from "./e-shape-uuid-mapping";
/**
* A shape deserializer
*/
export type EShapeDeserializer = (
item: DDiagramSerializedItem,
manager: EShapeResourceManagerDeserialization
) => Promise<EShape> | EShape | null;
/**
* Mappings of shape types and deserializers.
*/
export const EShapeDeserializers: Record<number, EShapeDeserializer | undefined> = {};
/**
* A handler which is called after the deserializations of all the shapes are completed.
*/
export type EShapeOnDeserialized = (
item: DDiagramSerializedItem,
shape: EShape,
mapping: EShapeUuidMapping,
manager: EShapeResourceManagerDeserialization
) => void;
/**
* Mappings of shape types and `onDeserialized` handlers.
*/
export const EShapeOnDeserializeds: Record<number, EShapeOnDeserialized | undefined> = {};