@types/scrivito 1.22.6 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scrivito/README.md +3 -15
- scrivito/package.json +5 -25
- scrivito/index.d.ts +0 -650
scrivito/README.md
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for scrivito (https://www.scrivito.com/).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scrivito.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Wed, 22 Nov 2023 00:24:48 GMT
|
|
12
|
-
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
|
13
|
-
|
|
14
|
-
# Credits
|
|
15
|
-
These definitions were written by [ Julian Krieger](https://github.com/juliankrieger), and [Eric Eifler](https://github.com/eric-the-viking).
|
|
1
|
+
This is a stub types definition for @types/scrivito (https://www.scrivito.com).
|
|
2
|
+
|
|
3
|
+
scrivito provides its own type definitions, so you don't need @types/scrivito installed!
|
scrivito/package.json
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/scrivito",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "TypeScript definitions for scrivito",
|
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scrivito",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": " Julian Krieger",
|
|
10
|
-
"githubUsername": "juliankrieger",
|
|
11
|
-
"url": "https://github.com/juliankrieger"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Eric Eifler",
|
|
15
|
-
"githubUsername": "eric-the-viking",
|
|
16
|
-
"url": "https://github.com/eric-the-viking"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
3
|
+
"version": "1.25.0",
|
|
4
|
+
"description": "Stub TypeScript definitions entry for scrivito, which provides its own types definitions",
|
|
19
5
|
"main": "",
|
|
20
|
-
"types": "index.d.ts",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
24
|
-
"directory": "types/scrivito"
|
|
25
|
-
},
|
|
26
6
|
"scripts": {},
|
|
7
|
+
"license": "MIT",
|
|
27
8
|
"dependencies": {
|
|
28
|
-
"
|
|
9
|
+
"scrivito": "*"
|
|
29
10
|
},
|
|
30
|
-
"
|
|
31
|
-
"typeScriptVersion": "4.5"
|
|
11
|
+
"deprecated": "This is a stub types definition. scrivito provides its own type definitions, so you do not need this installed."
|
|
32
12
|
}
|
scrivito/index.d.ts
DELETED
|
@@ -1,650 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Attribute definitions
|
|
5
|
-
*/
|
|
6
|
-
type Attribute =
|
|
7
|
-
| "boolean"
|
|
8
|
-
| "date"
|
|
9
|
-
| "datetime"
|
|
10
|
-
| "enum"
|
|
11
|
-
| "multienum"
|
|
12
|
-
| "html"
|
|
13
|
-
| "string"
|
|
14
|
-
| "stringlist"
|
|
15
|
-
| "integer"
|
|
16
|
-
| "float"
|
|
17
|
-
| "binary"
|
|
18
|
-
| "link"
|
|
19
|
-
| "linklist"
|
|
20
|
-
| "reference"
|
|
21
|
-
| "referencelist"
|
|
22
|
-
| "widgetlist";
|
|
23
|
-
|
|
24
|
-
interface AttributeOptions {
|
|
25
|
-
values?: string[] | undefined;
|
|
26
|
-
only?: string | string[] | undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type AttributeWithOptions = [Attribute, AttributeOptions];
|
|
30
|
-
|
|
31
|
-
interface OptimizeFor {
|
|
32
|
-
width?: number | string | undefined;
|
|
33
|
-
height?: number | string | undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface OptimizeForFit extends OptimizeFor {
|
|
37
|
-
fit: "crop";
|
|
38
|
-
crop: "center" | "top" | "left" | "right" | "bottom";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface OptimizeForResize extends OptimizeFor {
|
|
42
|
-
fit: "resize";
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type OptimizeDefinition = OptimizeForFit | OptimizeForResize;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Binary definitions
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
interface UploadOptions {
|
|
52
|
-
filename: string;
|
|
53
|
-
contentType?: string | undefined;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export class Binary {
|
|
57
|
-
private constructor();
|
|
58
|
-
static upload(source: Blob | File, options: UploadOptions): FutureBinary;
|
|
59
|
-
contentLength(): number;
|
|
60
|
-
contentType(): string;
|
|
61
|
-
copy(options?: { filename?: string | undefined; contentType?: string | undefined }): FutureBinary;
|
|
62
|
-
filename(): string;
|
|
63
|
-
isPrivate(): boolean;
|
|
64
|
-
metadata(): MetadataCollection;
|
|
65
|
-
optimizeFor(definition: OptimizeDefinition): Binary;
|
|
66
|
-
original(): Binary;
|
|
67
|
-
raw(): Binary;
|
|
68
|
-
url(): string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export class FutureBinary {
|
|
72
|
-
private constructor();
|
|
73
|
-
into(target: Obj): Promise<Binary>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Component definitions
|
|
78
|
-
*/
|
|
79
|
-
interface CSSImageStyleBackgroundProps {
|
|
80
|
-
image: Obj | Binary | string;
|
|
81
|
-
attachment?: React.CSSProperties["backgroundAttachment"] | undefined;
|
|
82
|
-
clip?: React.CSSProperties["backgroundClip"] | undefined;
|
|
83
|
-
color?: React.CSSProperties["backgroundColor"] | undefined;
|
|
84
|
-
origin?: React.CSSProperties["backgroundOrigin"] | undefined;
|
|
85
|
-
position?: React.CSSProperties["backgroundPosition"] | undefined;
|
|
86
|
-
repeat?: React.CSSProperties["backgroundRepeat"] | undefined;
|
|
87
|
-
size?: React.CSSProperties["backgroundSize"] | undefined;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
type CSSPropsWithoutBackground = Omit<
|
|
91
|
-
React.CSSProperties,
|
|
92
|
-
| "background"
|
|
93
|
-
| "backgroundAttachment"
|
|
94
|
-
| "backgroundClip"
|
|
95
|
-
| "backgroundColor"
|
|
96
|
-
| "backgroundPosition"
|
|
97
|
-
| "backgroundRepeat"
|
|
98
|
-
| "backgroundSize"
|
|
99
|
-
>;
|
|
100
|
-
|
|
101
|
-
interface BackgroundImageBackgroundProp {
|
|
102
|
-
background: CSSImageStyleBackgroundProps | CSSImageStyleBackgroundProps[];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
interface BackgroundImageTagProps {
|
|
106
|
-
tag?: string | undefined;
|
|
107
|
-
style: CSSPropsWithoutBackground & BackgroundImageBackgroundProp;
|
|
108
|
-
className?: string | undefined;
|
|
109
|
-
}
|
|
110
|
-
export class BackgroundImageTag extends React.Component<BackgroundImageTagProps, any> {}
|
|
111
|
-
|
|
112
|
-
interface ChildListTagProps {
|
|
113
|
-
parent?: Obj | undefined;
|
|
114
|
-
tag?: string | undefined;
|
|
115
|
-
renderChild?: ((child: Obj) => React.ReactElement) | undefined;
|
|
116
|
-
className?: string | undefined;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export class ChildListTag extends React.Component<ChildListTagProps, any> {}
|
|
120
|
-
|
|
121
|
-
interface ContentTagProps extends Omit<React.AllHTMLAttributes<any>, "content"> {
|
|
122
|
-
attribute: string;
|
|
123
|
-
content?: Obj | Widget | undefined;
|
|
124
|
-
tag?: string | undefined;
|
|
125
|
-
page?: any;
|
|
126
|
-
widgetProps?: object | undefined;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export class ContentTag extends React.Component<ContentTagProps, any> {}
|
|
130
|
-
|
|
131
|
-
export class CurrentPage extends React.Component<{}, any> {}
|
|
132
|
-
|
|
133
|
-
interface ImageTagProps extends Omit<React.HTMLAttributes<HTMLImageElement>, "content"> {
|
|
134
|
-
attribute?: string | undefined;
|
|
135
|
-
content: Binary | Obj | Widget;
|
|
136
|
-
alt?: string | undefined;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export class ImageTag extends React.Component<ImageTagProps, any> {}
|
|
140
|
-
|
|
141
|
-
export class InPlaceEditingOff extends React.Component<any, any> {}
|
|
142
|
-
|
|
143
|
-
interface LinkTagProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
144
|
-
to: Obj | Link;
|
|
145
|
-
params?: object | undefined;
|
|
146
|
-
onClick?: ((event: React.MouseEvent) => void) | undefined;
|
|
147
|
-
}
|
|
148
|
-
export class LinkTag extends React.Component<LinkTagProps, any> {}
|
|
149
|
-
|
|
150
|
-
export class NotFoundErrorPage extends React.Component<{}, any> {}
|
|
151
|
-
|
|
152
|
-
export class RestoreInPlaceEditing extends React.Component<{}, any> {}
|
|
153
|
-
|
|
154
|
-
interface WidgetTagProps extends React.HTMLAttributes<any> {
|
|
155
|
-
tag?: string | undefined;
|
|
156
|
-
[key: string]: any;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export class WidgetTag extends React.Component<WidgetTagProps, any> {}
|
|
160
|
-
|
|
161
|
-
type Priority = "foreground" | "background";
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Config definitions
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
interface ConfigOptions {
|
|
168
|
-
tenant: string;
|
|
169
|
-
homepage?: (() => Obj | null) | undefined;
|
|
170
|
-
origin?: string | undefined;
|
|
171
|
-
routingBasePath?: string | undefined;
|
|
172
|
-
visitorAuthentication?: boolean | undefined;
|
|
173
|
-
// Hard to type
|
|
174
|
-
constraintsValidation?: ((constraints: any) => any) | undefined;
|
|
175
|
-
endpoint?: string | undefined;
|
|
176
|
-
priority?: Priority | undefined;
|
|
177
|
-
adoptUi?: boolean | undefined;
|
|
178
|
-
baseUrlForSite?: ((siteId: string) => string | undefined) | undefined;
|
|
179
|
-
siteForUrl?: ((url: string) => { siteId: string; baseUrl: string } | undefined) | undefined;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* EditingConfig definitions
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
interface AttributeValue {
|
|
187
|
-
value: string;
|
|
188
|
-
title: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
interface AttributeProps {
|
|
192
|
-
title?: string | undefined;
|
|
193
|
-
description?: string | undefined;
|
|
194
|
-
values?: AttributeValue[] | undefined;
|
|
195
|
-
options?: {
|
|
196
|
-
toolbar: string[];
|
|
197
|
-
} | undefined;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
interface EditingConfigAttributes {
|
|
201
|
-
[key: string]: AttributeProps;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// TODO talk about this with krishan
|
|
205
|
-
interface PropertiesGroup {
|
|
206
|
-
title: string;
|
|
207
|
-
component?: string | undefined;
|
|
208
|
-
properties?: string[] | undefined;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export type ValidationReturnType = { message: string; severity: string } | string | undefined;
|
|
212
|
-
|
|
213
|
-
type AttributeValidationCallback = (
|
|
214
|
-
current: any,
|
|
215
|
-
options?: { obj?: Obj | undefined; widget?: Widget | undefined; content: any; name: string },
|
|
216
|
-
) => ValidationReturnType;
|
|
217
|
-
|
|
218
|
-
export type AttributeBasedValidation = [string, AttributeValidationCallback];
|
|
219
|
-
|
|
220
|
-
export type ClassBasedValidation = (target: Widget | Obj) => ValidationReturnType;
|
|
221
|
-
|
|
222
|
-
export type Validation = AttributeBasedValidation | ClassBasedValidation;
|
|
223
|
-
|
|
224
|
-
interface EditingConfig {
|
|
225
|
-
title?: string | undefined;
|
|
226
|
-
thumbnail?: string | undefined;
|
|
227
|
-
description?: string | undefined;
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
229
|
-
titleForContent?: ((instance: Obj | Widget) => string | void) | undefined;
|
|
230
|
-
descriptionForContent?: ((instance: Obj | Widget) => string) | undefined;
|
|
231
|
-
attributes?: EditingConfigAttributes | undefined;
|
|
232
|
-
properties?: string[] | undefined;
|
|
233
|
-
propertiesGroups?: PropertiesGroup[] | undefined;
|
|
234
|
-
hideInSelectionDialogs?: boolean | undefined;
|
|
235
|
-
initialContent?: Record<string, any> | undefined;
|
|
236
|
-
initialize?: ((instance: Obj) => void) | undefined;
|
|
237
|
-
initializeCopy?: ((originalInstance: Obj) => void) | undefined;
|
|
238
|
-
validations?: Validation[] | undefined;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Link definitions
|
|
243
|
-
*/
|
|
244
|
-
interface InternalLinkAttributes {
|
|
245
|
-
hash?: string | undefined;
|
|
246
|
-
obj: Obj;
|
|
247
|
-
query?: string | undefined;
|
|
248
|
-
rel?: string | undefined;
|
|
249
|
-
target?: string | undefined;
|
|
250
|
-
title?: string | undefined;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
interface ExternalLinkAttributes {
|
|
254
|
-
rel?: string | undefined;
|
|
255
|
-
target?: string | undefined;
|
|
256
|
-
title?: string | undefined;
|
|
257
|
-
url: string;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// Less guarantees
|
|
261
|
-
export class Link extends __Link {
|
|
262
|
-
constructor(attributes: InternalLinkAttributes | ExternalLinkAttributes);
|
|
263
|
-
hash(): string | null;
|
|
264
|
-
obj(): Obj | null;
|
|
265
|
-
query(): string | null;
|
|
266
|
-
url(): string | null;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
declare class __Link {
|
|
270
|
-
copy(attributes: InternalLinkAttributes): InternalLink;
|
|
271
|
-
copy(attributes: ExternalLinkAttributes): ExternalLink;
|
|
272
|
-
isExternal(): boolean;
|
|
273
|
-
isInternal(): boolean;
|
|
274
|
-
queryParamters(): any;
|
|
275
|
-
rel(): string | null;
|
|
276
|
-
target(): string | null;
|
|
277
|
-
title(): string | null;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// There are just interfaces and not newable
|
|
281
|
-
interface InternalLink extends __Link {
|
|
282
|
-
hash(): string;
|
|
283
|
-
obj(): Obj;
|
|
284
|
-
query(): string;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
interface ExternalLink extends __Link {
|
|
288
|
-
url(): string;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* MetadataCollection definitions
|
|
293
|
-
*/
|
|
294
|
-
|
|
295
|
-
export class MetadataCollection {
|
|
296
|
-
private constructor();
|
|
297
|
-
get(name: string): string | string[] | number | Date | null;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
interface CreateAttributes {
|
|
301
|
-
[key: string]: any;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
type ObjSearchOperator =
|
|
305
|
-
| "equals"
|
|
306
|
-
| "contains"
|
|
307
|
-
| "containsPrefix"
|
|
308
|
-
| "equals"
|
|
309
|
-
| "startsWith"
|
|
310
|
-
| "isLessThan"
|
|
311
|
-
| "isGreaterThan"
|
|
312
|
-
| "linksTo"
|
|
313
|
-
| "refersTo";
|
|
314
|
-
|
|
315
|
-
type ObjSearchSingleAttribute =
|
|
316
|
-
| "*"
|
|
317
|
-
| "id"
|
|
318
|
-
| "_createdAt"
|
|
319
|
-
| "_lastChanged"
|
|
320
|
-
| "_objClass"
|
|
321
|
-
| "_path"
|
|
322
|
-
| "_permalink"
|
|
323
|
-
| "_restriction"
|
|
324
|
-
| "MetadataCollection"
|
|
325
|
-
| string;
|
|
326
|
-
|
|
327
|
-
type ObjSearchValue = string | Date | number | Obj | any[];
|
|
328
|
-
|
|
329
|
-
type ObjSearchAttribute = ObjSearchSingleAttribute | ObjSearchSingleAttribute[];
|
|
330
|
-
|
|
331
|
-
interface ObjSearchAttributeBasedBoost {
|
|
332
|
-
[key: string]: number;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
type OrderParam = ObjSearchSingleAttribute | [ObjSearchSingleAttribute, "asc" | "desc"];
|
|
336
|
-
|
|
337
|
-
interface ObjFacetValue {
|
|
338
|
-
count: () => number;
|
|
339
|
-
includedObjs(): Obj[];
|
|
340
|
-
name: () => string;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export interface ObjSearch {
|
|
344
|
-
and: (
|
|
345
|
-
attribute: ObjSearchAttribute,
|
|
346
|
-
operator: ObjSearchOperator,
|
|
347
|
-
value: ObjSearchValue,
|
|
348
|
-
boost?: ObjSearchAttributeBasedBoost,
|
|
349
|
-
) => ObjSearch;
|
|
350
|
-
andNot: (
|
|
351
|
-
attribute: ObjSearchAttribute,
|
|
352
|
-
operator: Extract<ObjSearchOperator, "equals" | "startsWith" | "isGreaterThan" | "isLessThan">,
|
|
353
|
-
value: ObjSearchValue,
|
|
354
|
-
) => ObjSearch;
|
|
355
|
-
boost: (
|
|
356
|
-
attribute: ObjSearchAttribute,
|
|
357
|
-
operator: ObjSearchOperator,
|
|
358
|
-
value: ObjSearchValue,
|
|
359
|
-
factor: number,
|
|
360
|
-
) => ObjSearch;
|
|
361
|
-
count: () => number;
|
|
362
|
-
facet: (attribute: ObjSearchSingleAttribute, option?: { limit: number; includeObjs: number }) => ObjFacetValue;
|
|
363
|
-
first: () => Obj | null;
|
|
364
|
-
offset: (offSet: number) => ObjSearch;
|
|
365
|
-
order: (attributeOrAttributes: OrderParam | OrderParam[], direction: "asc" | "desc") => ObjSearch;
|
|
366
|
-
suggest: (prefix: string, options?: { limit: number; attributes: ObjSearchSingleAttribute[] }) => string[];
|
|
367
|
-
take: (count?: number) => Obj[];
|
|
368
|
-
toArray: () => Obj[];
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export class Obj {
|
|
372
|
-
private constructor(arg: object);
|
|
373
|
-
|
|
374
|
-
private readonly _createdAt: Date;
|
|
375
|
-
private readonly _firstPublishedAt: Date;
|
|
376
|
-
private readonly _lastChanged: Date;
|
|
377
|
-
private readonly _objClass: string;
|
|
378
|
-
private readonly _path: string;
|
|
379
|
-
private readonly _permalink: string;
|
|
380
|
-
private readonly _publishedAt: Date;
|
|
381
|
-
private readonly _siteId: string | null;
|
|
382
|
-
private readonly _language: string;
|
|
383
|
-
|
|
384
|
-
// Static methods
|
|
385
|
-
static all(): ObjSearch;
|
|
386
|
-
static create(attributes?: CreateAttributes): Obj;
|
|
387
|
-
static createFromFile(file: File, attributes: CreateAttributes): Promise<Obj>;
|
|
388
|
-
static get(id: string): Obj | null;
|
|
389
|
-
static getByPath(path: string): Obj | null;
|
|
390
|
-
static getByPermalink(permalink: string): Obj | null;
|
|
391
|
-
static root(): Obj | null;
|
|
392
|
-
static where(
|
|
393
|
-
attribute: ObjSearchSingleAttribute,
|
|
394
|
-
operator: ObjSearchOperator,
|
|
395
|
-
value: ObjSearchValue,
|
|
396
|
-
boost?: any,
|
|
397
|
-
): ObjSearch;
|
|
398
|
-
static onSite(siteId: string): SiteContext;
|
|
399
|
-
static onAllSites(): SiteContext;
|
|
400
|
-
|
|
401
|
-
// Instance methods
|
|
402
|
-
id(): string;
|
|
403
|
-
ancestors(): Obj[];
|
|
404
|
-
backlinks(): Obj[];
|
|
405
|
-
children(): Obj[];
|
|
406
|
-
contentLength(): number;
|
|
407
|
-
contentType(): string;
|
|
408
|
-
contentUrl(): string;
|
|
409
|
-
copy(): Promise<Obj>;
|
|
410
|
-
createdAt(): Date;
|
|
411
|
-
destroy(): void;
|
|
412
|
-
firstPublishedAt(): Date | null;
|
|
413
|
-
get(attributeName: string): any;
|
|
414
|
-
isBinary(): boolean;
|
|
415
|
-
isRestricted(): boolean;
|
|
416
|
-
lastChanged(): Date | null;
|
|
417
|
-
metadata(): MetadataCollection;
|
|
418
|
-
modification(): null | "new" | "edited" | "deleted";
|
|
419
|
-
objClass(): string;
|
|
420
|
-
parent(): Obj | null;
|
|
421
|
-
path(): string | null;
|
|
422
|
-
permalink(): string | null;
|
|
423
|
-
publishedAt(): Date | null;
|
|
424
|
-
restrict(): void;
|
|
425
|
-
slug(): string;
|
|
426
|
-
unrestrict(): void;
|
|
427
|
-
update(attributes: any): void;
|
|
428
|
-
widget(id: string): Widget | null;
|
|
429
|
-
widgets(): Widget[];
|
|
430
|
-
updateReferences(mapping: (refId: string) => string | undefined): Promise<void>;
|
|
431
|
-
finishSaving(): Promise<void>;
|
|
432
|
-
onAllSites(): SiteContext;
|
|
433
|
-
onSite(siteId: string): SiteContext;
|
|
434
|
-
siteId(): string | null;
|
|
435
|
-
language(): string | null;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
type ExtractableTextAttributes = "string" | "html" | "widgetlist" | "blob:text";
|
|
439
|
-
|
|
440
|
-
interface SiteContext {
|
|
441
|
-
all(): ObjSearch;
|
|
442
|
-
create(attributes: object): Obj;
|
|
443
|
-
createFromFile(file: File, attributes: object): Promise<void>;
|
|
444
|
-
get(id: string): Obj | null;
|
|
445
|
-
getByPath(path: string): Obj | null;
|
|
446
|
-
getByPermalink(permalink: string): Obj | null;
|
|
447
|
-
root(): Obj | null;
|
|
448
|
-
where(attribute: ObjSearchSingleAttribute, operator: ObjSearchOperator, value: string, boost?: any): ObjSearch;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
interface ObjClassOptions {
|
|
452
|
-
attributes: Record<string, Attribute | AttributeWithOptions>;
|
|
453
|
-
extractTextAttributes?: string[] | undefined;
|
|
454
|
-
extend?: ObjClass | undefined;
|
|
455
|
-
onlyChildren: string | string[];
|
|
456
|
-
onlyInside: string | string[];
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
export type ObjClass = typeof Obj;
|
|
460
|
-
|
|
461
|
-
declare abstract class AbstractObjClass {}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Widget definitions
|
|
465
|
-
*/
|
|
466
|
-
|
|
467
|
-
export class Widget {
|
|
468
|
-
constructor(arg: object);
|
|
469
|
-
private readonly _id: string;
|
|
470
|
-
private _objClass: string;
|
|
471
|
-
|
|
472
|
-
// Instace methods
|
|
473
|
-
container(): Obj | Widget;
|
|
474
|
-
copy(): void;
|
|
475
|
-
destroy(): void;
|
|
476
|
-
get(attributeName: string): any;
|
|
477
|
-
id(): string;
|
|
478
|
-
obj(): Obj;
|
|
479
|
-
objClass(): string;
|
|
480
|
-
update(attributes: any): void;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
interface WidgetClassOptions {
|
|
484
|
-
attributes: Record<string, Attribute | AttributeWithOptions>;
|
|
485
|
-
extractTextAttributes?: string[] | undefined;
|
|
486
|
-
extend?: WidgetClass | undefined;
|
|
487
|
-
onlyInside?: string | string[] | undefined;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
type WidgetClass = typeof Widget;
|
|
491
|
-
|
|
492
|
-
declare abstract class AbstractWidgetClass {}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* scrivito top-level definitions
|
|
496
|
-
*/
|
|
497
|
-
|
|
498
|
-
interface WidgetComponentProps {
|
|
499
|
-
widget: Widget;
|
|
500
|
-
[key: string]: any;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
interface ObjComponentProps {
|
|
504
|
-
page: Obj;
|
|
505
|
-
params: {};
|
|
506
|
-
[key: string]: any;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
type WidgetComponent = React.ComponentType<WidgetComponentProps>;
|
|
510
|
-
type ObjComponent = React.ComponentType<ObjComponentProps>;
|
|
511
|
-
|
|
512
|
-
export interface AuthGroupsOptions {
|
|
513
|
-
[groupName: string]: string;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export class Editor {
|
|
517
|
-
private constructor();
|
|
518
|
-
id(): string;
|
|
519
|
-
name(): string;
|
|
520
|
-
teams(): Team[];
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
export class Team {
|
|
524
|
-
private constructor();
|
|
525
|
-
description(): string;
|
|
526
|
-
id(): string;
|
|
527
|
-
name(): string;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
interface MenuPosition {
|
|
531
|
-
before: string;
|
|
532
|
-
after: string;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
interface MenuInsertParameters {
|
|
536
|
-
id: string;
|
|
537
|
-
title: string;
|
|
538
|
-
icon?: string | undefined;
|
|
539
|
-
description?: string | undefined;
|
|
540
|
-
position?: MenuPosition | undefined;
|
|
541
|
-
group?: string | undefined;
|
|
542
|
-
onClick: () => void;
|
|
543
|
-
enabled?: boolean | undefined;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
type MenuModifyParameters = Pick<MenuInsertParameters, "id" | "group" | "icon" | "position" | "title">;
|
|
547
|
-
|
|
548
|
-
interface Menu {
|
|
549
|
-
insert: (params: MenuInsertParameters) => void;
|
|
550
|
-
remove: (id: string) => void;
|
|
551
|
-
modify: (params: MenuModifyParameters) => void;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
export type ValidationResultSeverity = "error" | "warning" | "info";
|
|
555
|
-
|
|
556
|
-
export interface ValidationResult {
|
|
557
|
-
message: string;
|
|
558
|
-
severity: ValidationResultSeverity;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
declare class Workspace {
|
|
562
|
-
private constructor();
|
|
563
|
-
id(): string;
|
|
564
|
-
title(): string;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
export function canWrite(): boolean;
|
|
568
|
-
export function configure(options: ConfigOptions): void;
|
|
569
|
-
export function configureContentBrowser(options: any): void;
|
|
570
|
-
export function connect<C extends React.ComponentType<any>>(component: C): C;
|
|
571
|
-
export function currentPage(): Obj;
|
|
572
|
-
export function currentPageParams(): any;
|
|
573
|
-
export function extendMenu(menuCallback: (menu: Menu) => void): void;
|
|
574
|
-
export function extractText(obj: Obj, options: { length: number }): string;
|
|
575
|
-
export function finishLoading(): Promise<{}>;
|
|
576
|
-
export function getClass(name: string): ObjClass | WidgetClass | null;
|
|
577
|
-
export function isEditorLoggedIn(): boolean;
|
|
578
|
-
export function isInPlaceEditingActive(): boolean;
|
|
579
|
-
export function load<T>(functionToLoad: () => T): Promise<T>;
|
|
580
|
-
export function navigateTo(
|
|
581
|
-
target: (() => Obj | Link) | Obj | Link,
|
|
582
|
-
options?: { hash?: string | undefined; params?: any },
|
|
583
|
-
): void;
|
|
584
|
-
export function openDialog(name: string): void;
|
|
585
|
-
export function preload(preloadDump: any): Promise<{ dumpLoaded: boolean }>;
|
|
586
|
-
export function provideComponent(className: string, component: WidgetComponent | ObjComponent): void;
|
|
587
|
-
export function provideEditingConfig(name: string, editingConfig: EditingConfig): void;
|
|
588
|
-
export function provideAuthGroups(options: AuthGroupsOptions): void;
|
|
589
|
-
export function createObjClass(options: ObjClassOptions): Obj;
|
|
590
|
-
export function createWidgetClass(options: WidgetClassOptions): AbstractWidgetClass;
|
|
591
|
-
export function provideObjClass(name: string, contentClassOrOptions: ObjClassOptions | AbstractObjClass): ObjClass;
|
|
592
|
-
export function provideWidgetClass(
|
|
593
|
-
name: string,
|
|
594
|
-
contentClassOrOptions: WidgetClassOptions | AbstractWidgetClass,
|
|
595
|
-
): WidgetClass;
|
|
596
|
-
export function registerComponent(name: string, component: WidgetComponent | ObjComponent): void;
|
|
597
|
-
export function renderPage(page: Obj, renderFunction: () => void): Promise<{ result: Obj; preloadDump: any }>;
|
|
598
|
-
export function setVisitorIdToken(idToken: string): void;
|
|
599
|
-
export function updateContent(): void;
|
|
600
|
-
export function updateMenuExtensions(): void;
|
|
601
|
-
export function urlFor(
|
|
602
|
-
target: Obj | Binary | Link,
|
|
603
|
-
options?: { query?: string | undefined; hash?: string | undefined },
|
|
604
|
-
): string;
|
|
605
|
-
export function useHistory(history: History): void;
|
|
606
|
-
export function validationResultsFor(model: Obj | Widget, attribute: string): ValidationResult[];
|
|
607
|
-
export function isComparisonActive(): boolean;
|
|
608
|
-
export function currentWorkspaceId(): string;
|
|
609
|
-
export function currentWorkspace(): Workspace;
|
|
610
|
-
export function currentEditor(): Editor | null;
|
|
611
|
-
export function configureObjClassForContentType(mapping?: { [key: string]: string }): void;
|
|
612
|
-
|
|
613
|
-
// utility types
|
|
614
|
-
|
|
615
|
-
type AttributeKeys<T extends WidgetClassOptions | ObjClassOptions> = {
|
|
616
|
-
[Property in keyof T["attributes"]]: any;
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
export type {
|
|
620
|
-
AttributeKeys,
|
|
621
|
-
AttributeOptions,
|
|
622
|
-
AttributeProps,
|
|
623
|
-
AttributeValue,
|
|
624
|
-
BackgroundImageBackgroundProp,
|
|
625
|
-
BackgroundImageTagProps,
|
|
626
|
-
ChildListTagProps,
|
|
627
|
-
ConfigOptions,
|
|
628
|
-
ContentTagProps,
|
|
629
|
-
CreateAttributes,
|
|
630
|
-
CSSImageStyleBackgroundProps,
|
|
631
|
-
EditingConfig,
|
|
632
|
-
EditingConfigAttributes,
|
|
633
|
-
ExternalLink,
|
|
634
|
-
ExternalLinkAttributes,
|
|
635
|
-
ImageTagProps,
|
|
636
|
-
InternalLink,
|
|
637
|
-
InternalLinkAttributes,
|
|
638
|
-
LinkTagProps,
|
|
639
|
-
ObjClassOptions,
|
|
640
|
-
ObjComponentProps,
|
|
641
|
-
OptimizeDefinition,
|
|
642
|
-
PropertiesGroup,
|
|
643
|
-
SiteContext,
|
|
644
|
-
WidgetClassOptions,
|
|
645
|
-
WidgetComponentProps,
|
|
646
|
-
WidgetTagProps,
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
// Disables automatic exports
|
|
650
|
-
export {};
|