|
1 | 1 | import { Codec } from '../../../utils/io-ts';
|
2 |
| -import { Style, StyleCodec } from '../objects/style'; |
3 |
| -import { ObjectID, ObjectIDCodec } from '../objects/object-id'; |
| 2 | +import { Style, StyleCodec } from './style'; |
| 3 | +import { ObjectID, ObjectIDCodec } from './object-id'; |
4 | 4 | import { string, type, array, recursion, boolean } from 'io-ts';
|
5 | 5 | import { optionFromNullable } from 'io-ts-types/lib/optionFromNullable';
|
6 | 6 | import { Option } from 'fp-ts/lib/Option';
|
| 7 | +import { OverrideValue, OverrideValueCodec } from './override-value'; |
| 8 | +import { LayerClass, LayerClassCodec } from '../enums/layer-class'; |
7 | 9 |
|
8 | 10 | export interface Layer {
|
9 |
| - readonly _class: string; |
| 11 | + readonly _class: LayerClass; |
10 | 12 | readonly do_objectID: ObjectID;
|
11 | 13 | readonly name: string;
|
12 | 14 | readonly style: Style;
|
13 | 15 | readonly layers: Option<Layer[]>;
|
14 | 16 | readonly isVisible: boolean;
|
| 17 | + readonly overrideValues: Option<OverrideValue[]>; |
| 18 | + readonly sharedStyleID: Option<ObjectID>; |
| 19 | + readonly symbolID: Option<ObjectID>; |
15 | 20 | }
|
16 | 21 |
|
17 | 22 | export const LayerCodec: Codec<Layer> = recursion('Layer', () =>
|
18 | 23 | type(
|
19 | 24 | {
|
20 |
| - _class: string, |
| 25 | + _class: LayerClassCodec, |
21 | 26 | do_objectID: ObjectIDCodec,
|
22 | 27 | name: string,
|
23 | 28 | style: StyleCodec,
|
24 | 29 | isVisible: boolean,
|
25 | 30 | layers: optionFromNullable(array(LayerCodec)),
|
| 31 | + overrideValues: optionFromNullable(array(OverrideValueCodec)), |
| 32 | + sharedStyleID: optionFromNullable(ObjectIDCodec), |
| 33 | + symbolID: optionFromNullable(ObjectIDCodec), |
26 | 34 | },
|
27 | 35 | 'Layer',
|
28 | 36 | ),
|
|
0 commit comments