/
IWithLayout.ts
68 lines (67 loc) · 1.49 KB
/
IWithLayout.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
import { IRequestOptions } from "@esri/arcgis-rest-request";
import { IHubLayout } from "../types/IHubLayout";
/**
* Properties associated with a Layout
*/
export interface IWithLayout {
/**
* Layout property
*/
layout?: IHubLayout;
}
/**
* Defined layout related functions that a module
* working with IWithLayout objects must implement
*/
export interface IWithLayoutStore {
/**
* Given a version name, copy that into the item's /data
* making it the "active version"
* @param id
* @param ro
*/
setActiveVersion(id: string, ro: IUserRequestOptions): Promise<void>;
/**
* Return a list of all the versions by name
* @param id
* @param ro
*/
listVersions(id: string, ro: IRequestOptions): Promise<string[]>;
/**
* Destroy the resource backing a version
* @param id
* @param name
* @param ro
*/
destroyVersion(
id: string,
name: string,
ro: IUserRequestOptions
): Promise<void>;
/**
* Store a version as a resource, with the given name
* @param id
* @param name
* @param layout
* @param ro
*/
saveVersion(
id: string,
name: string,
layout: IHubLayout,
ro: IUserRequestOptions
): Promise<void>;
/**
* Fetch the layout from a specific version.
* Used when editing a specific version.
* @param id
* @param name
* @param ro
*/
loadVersion(
id: string,
name: string,
ro: IRequestOptions
): Promise<IHubLayout>;
}