@openedc/sdk 3.8.1

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.
@@ -0,0 +1,1136 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export type DataStateMessageEvent = {
4
+ store: string;
5
+ method: CRUDTypes;
6
+ state: Record<string, unknown>;
7
+ };
8
+ declare const CRUDMethods: {
9
+ readonly INSERT: "INSERT";
10
+ readonly UPDATE: "UPDATE";
11
+ readonly DELETE: "DELETE";
12
+ };
13
+ export type CRUDTypes = typeof CRUDMethods[keyof typeof CRUDMethods];
14
+ export type QueryCallback<T extends DataBlock> = ((data: any, updatedBlock?: T, crud?: CRUDTypes) => void);
15
+ declare class LiveQuery<T extends DataBlock> {
16
+ queryResult: QueryResult;
17
+ callbacks: QueryCallback<T>[];
18
+ dataCache: T[];
19
+ constructor(queryResult: QueryResult, callback: QueryCallback<T>);
20
+ start(): Promise<this>;
21
+ executeQuery(): Promise<void>;
22
+ executeCallbacks(updatedBlock?: T, crud?: CRUDTypes): void;
23
+ debounceCallbacks: (updatedBlock?: T | undefined, crud?: CRUDTypes | undefined) => void;
24
+ evaluateDataChange({ store, method, state }: DataStateMessageEvent, debounce?: boolean): Promise<void>;
25
+ find(block: typeof DataBlock, key: string, value: unknown): DataBlock | undefined;
26
+ recursivelyInsertData(block: DataBlock, data: Record<string, unknown>, visited?: Record<string, DataBlock>): Promise<DataBlock>;
27
+ selectivelyAdoptChanges(block: DataBlock, data: Record<string, unknown>): Promise<DataBlock>;
28
+ parseReferences(store: string, data: Record<string, unknown>): Record<string, unknown>;
29
+ addCallback(callback: QueryCallback<T>): this;
30
+ removeCallback(callback: QueryCallback<T>): void;
31
+ }
32
+ export type Policy = {
33
+ name: string;
34
+ command: "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "ALL";
35
+ expression: string;
36
+ check?: string;
37
+ restricted?: {
38
+ permission: string;
39
+ fields: string[];
40
+ };
41
+ };
42
+ export type RawData<T extends DataBlock> = {
43
+ [K in keyof T as T[K] extends Function ? never : K]: T[K] extends DataBlock | BlockReference<DataBlock> ? string : T[K] extends DataBlock | BlockReference<DataBlock> | undefined ? string | undefined : T[K] extends DataBlock[] | BlockReference<DataBlock>[] ? string[] : T[K] extends DataBlock[] | BlockReference<DataBlock>[] | undefined ? string[] | undefined : T[K];
44
+ };
45
+ export type AuditData<T extends DataBlock> = RawData<T> & {
46
+ [K in keyof AuditRecord as AuditRecord[K] extends Function ? never : K]: AuditRecord[K];
47
+ };
48
+ export type DataDifference = AuditData<any> & {
49
+ store: string;
50
+ previous: Record<string, unknown>;
51
+ current: Record<string, unknown>;
52
+ };
53
+ declare class AuditRecord {
54
+ static readonly collectionName = "audit";
55
+ static fields: Record<string, FieldDefinition>;
56
+ method: CRUDTypes;
57
+ timestamp: number;
58
+ userUUID: string;
59
+ reason?: string;
60
+ constructor(method: CRUDTypes, userUUID: string, reason?: string);
61
+ static fromBlock(constructor: typeof DataBlock): typeof DataBlock;
62
+ static getDifferences: (constructor: typeof DataBlock, records: AuditData<any>[], keys: string[]) => DataDifference[];
63
+ static derivePolicies(policies: Policy[]): Policy[];
64
+ with(data: Record<string, unknown>): {
65
+ method: CRUDTypes;
66
+ timestamp: number;
67
+ userUUID: string;
68
+ reason: string | undefined;
69
+ } & Record<string, unknown>;
70
+ }
71
+ declare const ProjectStatus: {
72
+ readonly draft: "draft";
73
+ readonly production: "production";
74
+ readonly finished: "finished";
75
+ readonly archived: "archived";
76
+ };
77
+ export declare class Project extends DataBlock {
78
+ name: string;
79
+ description: string | undefined;
80
+ status: typeof ProjectStatus[keyof typeof ProjectStatus];
81
+ owner: BlockReference<User>;
82
+ timeZone?: string;
83
+ startDate?: string;
84
+ endDate?: string;
85
+ publicProjectKey?: string;
86
+ fileMegabyteLimit?: number;
87
+ smsSendLimit?: number;
88
+ mfaRequired?: boolean;
89
+ constructor(name: string, owner: BlockReference<User>);
90
+ static getUrl(uuid: string, site?: string): string;
91
+ getUrl(site?: string): string;
92
+ }
93
+ export type ValidKey = Exclude<IDBValidKey, Date | BufferSource>;
94
+ export type ExtendedKey = ValidKey | DataBlock | BlockReference<DataBlock> | Record<string, ValidKey | undefined> | undefined;
95
+ declare class QueryResult {
96
+ uuid: string;
97
+ projectUUID: string | undefined;
98
+ block: typeof DataBlock;
99
+ where: WhereResult[];
100
+ sort: SortResult[];
101
+ update?: Record<string, unknown>;
102
+ delete?: boolean;
103
+ first: boolean;
104
+ constructor(block: typeof DataBlock);
105
+ toString(): string;
106
+ dataDoesMatch(store: string, data: DataBlock | Record<string, unknown>): boolean;
107
+ }
108
+ declare class WhereResult {
109
+ field: string;
110
+ operator: "=" | "!=" | ">=" | "<=" | "in" | "any" | "between";
111
+ value: ValidKey | Record<string, ValidKey | undefined> | undefined;
112
+ union: "and" | "or" | undefined;
113
+ constructor(field: string, operator: WhereResult["operator"], value: WhereResult["value"], union: WhereResult["union"]);
114
+ dataDoesMatch(data: DataBlock | Record<string, unknown>): boolean | undefined;
115
+ }
116
+ declare class SortResult {
117
+ field: string;
118
+ type: "asc" | "desc";
119
+ constructor(field: string, type: SortResult["type"]);
120
+ }
121
+ declare class Where<T extends typeof DataBlock> {
122
+ protected fieldName: string;
123
+ protected result: QueryResult;
124
+ protected union: WhereResult["union"];
125
+ constructor(fieldName: string, result: QueryResult, union?: WhereResult["union"]);
126
+ protected finalizeWhere(value: ExtendedKey, operator: WhereResult["operator"], union?: WhereResult["union"]): void;
127
+ equals(value: ExtendedKey): Collection<T>;
128
+ notEquals(value: ExtendedKey): Collection<T>;
129
+ greaterThanOrEqual(value: ExtendedKey): Collection<T>;
130
+ lowerThanOrEqual(value: ExtendedKey): Collection<T>;
131
+ includes(value: ExtendedKey): Collection<T>;
132
+ equalsAny(values: ValidKey[]): Collection<T>;
133
+ between(from: ValidKey, to: ValidKey): Collection<T>;
134
+ }
135
+ declare class Sort<T extends typeof DataBlock> {
136
+ protected fieldName: string;
137
+ protected result: QueryResult;
138
+ constructor(fieldName: string, result: QueryResult);
139
+ protected finalizeSort(type: SortResult["type"]): void;
140
+ asc(): Collection<T>;
141
+ desc(): Collection<T>;
142
+ }
143
+ declare class Collection<T extends typeof DataBlock> {
144
+ protected result: QueryResult;
145
+ constructor(result: QueryResult);
146
+ sort(fieldName: string): Sort<T>;
147
+ or(fieldName: string): void;
148
+ and(fieldName: string): Where<T>;
149
+ project(project?: Project | string): this;
150
+ all(): Promise<InstanceType<T>[]>;
151
+ all(options: {
152
+ raw: boolean;
153
+ }): Promise<RawData<InstanceType<T>>[]>;
154
+ all(callback: (data: InstanceType<T>[], updatedBlock?: InstanceType<T>, crud?: CRUDTypes) => void): Promise<LiveQuery<InstanceType<T>>>;
155
+ first(): Promise<InstanceType<T> | undefined>;
156
+ first(options: {
157
+ raw: boolean;
158
+ }): Promise<RawData<InstanceType<T>>>;
159
+ first(callback: (data?: InstanceType<T>, updatedBlock?: InstanceType<T>, crud?: CRUDTypes) => void): Promise<LiveQuery<InstanceType<T>>>;
160
+ private executeQuery;
161
+ audit(): Promise<AuditData<InstanceType<T>>[]>;
162
+ update(data: Partial<RawData<InstanceType<T>>>): Promise<Record<string, unknown>[]>;
163
+ delete(): Promise<Record<string, unknown>[]>;
164
+ }
165
+ export interface PersistenceAdapter {
166
+ offline?: boolean;
167
+ getObject: (definition: BlockDefinition, key: Record<string, string>) => Promise<Record<string, unknown> | undefined>;
168
+ setObject: (definition: BlockDefinition, value: Record<string, unknown>, reason?: string, refresh?: boolean) => Promise<void>;
169
+ setObjects: (definition: BlockDefinition, values: Record<string, unknown>[], reasons?: Record<string, string | undefined>, refresh?: boolean) => Promise<void>;
170
+ deleteObject: (definition: BlockDefinition, key: Record<string, string>, reason?: string) => Promise<void>;
171
+ executeQuery: (queryResult: QueryResult) => Promise<Record<string, unknown> | Record<string, unknown>[]>;
172
+ registerLiveQuery?: (queryResult: QueryResult) => void;
173
+ unregisterLiveQuery?: (queryResult: QueryResult) => void;
174
+ uploadFile?: (file: File, published: boolean, callback?: (progress: number) => void) => Promise<string>;
175
+ getFileURL?: (externalId: string, published: boolean, expiration: number) => Promise<string>;
176
+ }
177
+ export type BlockDefinition = {
178
+ collection: string;
179
+ store: string;
180
+ auto?: boolean;
181
+ audit?: boolean;
182
+ global?: boolean;
183
+ compound?: boolean;
184
+ snapshot?: boolean;
185
+ restricted?: boolean;
186
+ version?: number;
187
+ };
188
+ export type FieldType = typeof String | typeof Number | typeof Boolean | typeof Date | typeof Object | string;
189
+ export type FieldDefinition = {
190
+ key?: boolean;
191
+ index?: boolean;
192
+ unique?: boolean;
193
+ lazy?: boolean;
194
+ group?: string;
195
+ type?: FieldType | FieldType[];
196
+ relation?: typeof DataBlock | typeof DataBlock[];
197
+ delete?: "unset" | "cascade";
198
+ };
199
+ declare class DataBlock {
200
+ static adapter: PersistenceAdapter;
201
+ static fields: Record<string, FieldDefinition>;
202
+ static definition: BlockDefinition;
203
+ static keyPath?: string[];
204
+ protected internal: {
205
+ lastState?: Record<string, unknown>;
206
+ };
207
+ readonly uuid: string;
208
+ readonly project?: string;
209
+ readonly createdDate: number;
210
+ constructor(..._: unknown[]);
211
+ static deriveKey(data: Record<string, unknown>): {
212
+ [k: string]: string;
213
+ };
214
+ static referenceWith<T extends typeof DataBlock>(this: T, uuid: string): BlockReference<InstanceType<T>>;
215
+ get static(): typeof DataBlock;
216
+ protected get children(): DataBlock[];
217
+ static where<T extends typeof DataBlock>(this: T): Collection<T>;
218
+ static where<T extends typeof DataBlock>(this: T, value: string): Where<T>;
219
+ static where<T extends typeof DataBlock>(this: T, value: Record<string, ExtendedKey>): Collection<T>;
220
+ commit(options?: {
221
+ cascade?: boolean;
222
+ project?: Project | string;
223
+ reason?: string;
224
+ refresh?: boolean;
225
+ }, transaction?: string): Promise<this>;
226
+ static commit(data: DataBlock[], project?: string, reasons?: Record<string, string>, refresh?: boolean): Promise<void>;
227
+ protected beforeTrigger(): Promise<void> | void;
228
+ protected afterTrigger(): Promise<void> | void;
229
+ prepareSerialization(): Promise<void> | void;
230
+ discard(): Promise<void>;
231
+ private updateLocalQueryCache;
232
+ delete(options?: {
233
+ cascade?: boolean;
234
+ reason?: string;
235
+ }): Promise<undefined>;
236
+ get changedFields(): Record<string, unknown>;
237
+ toObject(): Record<string, unknown>;
238
+ toString(): string;
239
+ clone(options?: {
240
+ cascade?: boolean;
241
+ custom?: (original: DataBlock) => DataBlock | void;
242
+ adjust?: (clone: DataBlock) => void;
243
+ }, visited?: Record<string, DataBlock>): this;
244
+ find<T extends typeof DataBlock>(block: T, key?: string, value?: unknown, all?: boolean, visited?: Set<string>): InstanceType<T> | undefined;
245
+ find<T extends typeof DataBlock>(block: T, key: string | undefined, value: unknown | undefined, all: true, visited?: Set<string>): InstanceType<T>[] | undefined;
246
+ set(values: Partial<this>): this & Partial<this>;
247
+ get uncommitted(): boolean;
248
+ get reference(): BlockReference<this>;
249
+ private static withCache;
250
+ static getByUUID<T extends typeof DataBlock>(this: T, uuid: string): Promise<InstanceType<T>>;
251
+ static fromObject<T extends typeof DataBlock>(this: T, state: Record<string, unknown>): Promise<InstanceType<T>>;
252
+ static rebuildBlock<T extends typeof DataBlock>(this: T, state: Record<string, unknown>): Promise<InstanceType<T>>;
253
+ }
254
+ declare class BlockReference<T extends DataBlock> {
255
+ collection: string;
256
+ store: string;
257
+ uuid: string;
258
+ constructor(collection: string, store: string, uuid: string);
259
+ static fromString<T extends DataBlock>(value: unknown): BlockReference<T> | undefined;
260
+ get data(): Promise<T>;
261
+ toString(): string;
262
+ }
263
+ declare const AdminRights: {
264
+ readonly MANAGE_ALL_DATA: "manage-all-data";
265
+ readonly CREATE_OWN_PROJECTS: "create-own-projects";
266
+ readonly VIEW_EXISTING_USERS: "view-existing-users";
267
+ };
268
+ export declare class User extends DataBlock {
269
+ oid: string;
270
+ givenName?: string;
271
+ familyName?: string;
272
+ email?: string;
273
+ language?: string;
274
+ adminRights: typeof AdminRights[keyof typeof AdminRights][];
275
+ constructor(oid: string);
276
+ beforeTrigger(): void;
277
+ hasAdminRight(...rights: User["adminRights"]): boolean;
278
+ get fullName(): string | undefined;
279
+ }
280
+ declare const OID_SUFFIX = "OID";
281
+ declare const INSTANCE_SUFFIX = "Instance";
282
+ declare const ENTRIES: {
283
+ studyEventGroup: undefined;
284
+ studyEvent: boolean;
285
+ form: boolean;
286
+ section: boolean;
287
+ item: undefined;
288
+ dataset: undefined;
289
+ };
290
+ export type FlatPathOIDs = {
291
+ [K in keyof typeof ENTRIES as `${K}${typeof OID_SUFFIX}`]?: string;
292
+ };
293
+ export type FlatPathInstances = {
294
+ [K in keyof typeof ENTRIES as typeof ENTRIES[K] extends boolean ? `${K}${typeof INSTANCE_SUFFIX}` : never]?: number;
295
+ };
296
+ export type FlatPath = FlatPathOIDs & FlatPathInstances;
297
+ export declare class ODMPath {
298
+ private values;
299
+ constructor(values: Record<string, string | number>, until?: keyof typeof ENTRIES);
300
+ static unequal(a?: ODMPath, b?: ODMPath): boolean;
301
+ static from(value: string): ODMPath;
302
+ static uniques<T extends keyof FlatPath>(paths: ODMPath[], value: T): (ODMPath[T] & {})[];
303
+ static with(path?: ODMPath | FlatPath, until?: keyof typeof ENTRIES): ODMPath;
304
+ with(path?: ODMPath | FlatPath, until?: keyof typeof ENTRIES): ODMPath;
305
+ relative(reference?: ODMPath | FlatPath): ODMPath;
306
+ toString(): string;
307
+ toObject(): FlatPath;
308
+ filter: (element: Partial<FlatPath>) => boolean;
309
+ get formless(): ODMPath;
310
+ get studyEventGroupOID(): string | undefined;
311
+ get studyEventOID(): string | undefined;
312
+ get studyEventInstance(): number | undefined;
313
+ get formOID(): string | undefined;
314
+ get formInstance(): number | undefined;
315
+ get sectionOID(): string | undefined;
316
+ get sectionInstance(): number | undefined;
317
+ get itemOID(): string | undefined;
318
+ get datasetOID(): string | undefined;
319
+ get fieldOID(): string | undefined;
320
+ }
321
+ declare class Location$1 extends DataBlock {
322
+ oid: string;
323
+ name: string;
324
+ address?: string;
325
+ timeZone?: string;
326
+ constructor(oid: string, name: string, address?: string);
327
+ }
328
+ export declare class Alias extends DataBlock {
329
+ context: string;
330
+ name: string;
331
+ static prefix: string;
332
+ constructor(context: string, name: string);
333
+ static addPrefixed(aliases: Alias[], context: string, name?: string | number): Alias | undefined;
334
+ static findPrefixed(aliases: Alias[], context: string): string | undefined;
335
+ hasPrefixed(context: string): boolean;
336
+ }
337
+ export declare class TranslatedText extends DataBlock {
338
+ lang: string;
339
+ text: string;
340
+ type: "text/plain" | "text/html" | "text/markdown";
341
+ constructor(lang: string, text: string, type?: TranslatedText["type"]);
342
+ private getType;
343
+ get template(): string;
344
+ setText(value: string, type?: TranslatedText["type"]): void;
345
+ }
346
+ export type TranslatedModel = DataBlock & {
347
+ readonly id: string;
348
+ readonly texts: Description;
349
+ };
350
+ export declare class Description extends DataBlock {
351
+ translatedTexts: TranslatedText[];
352
+ getText(lang?: string): string | undefined;
353
+ getTemplate(lang?: string): string | undefined;
354
+ setText(lang: string, value?: string | null, type?: TranslatedText["type"]): TranslatedText | this | undefined;
355
+ static setText(element: DataBlock & {
356
+ description?: Description;
357
+ }, lang: string, value?: string | null): (DataBlock & {
358
+ description?: Description;
359
+ }) | undefined;
360
+ }
361
+ export declare class ConditionDef extends DataBlock {
362
+ oid: string;
363
+ formalExpression: string;
364
+ constructor(oid: string, formalExpression: string);
365
+ }
366
+ export declare class Decode extends Description {
367
+ }
368
+ export declare class CodeListItem extends DataBlock implements TranslatedModel {
369
+ codedValue: string;
370
+ decode: Decode;
371
+ description: Description | undefined;
372
+ constructor(codedValue: string);
373
+ get id(): string;
374
+ get texts(): Decode;
375
+ }
376
+ export declare class CodeList extends DataBlock {
377
+ oid: string;
378
+ name: string;
379
+ dataType: "integer" | "decimal" | "text" | "string";
380
+ codeListItems: CodeListItem[];
381
+ constructor(oid: string);
382
+ addCodeListItem(lang: string, translatedText?: string | null, codedValue?: string, index?: number): void;
383
+ get codedValueIncrement(): string;
384
+ get fingerprint(): string;
385
+ }
386
+ export declare class CodeListRef extends DataBlock {
387
+ codeList: CodeList;
388
+ constructor(codeList: CodeList);
389
+ }
390
+ export declare class Question extends Description {
391
+ }
392
+ export declare class FormalExpression extends DataBlock {
393
+ context: string;
394
+ code: string;
395
+ constructor(context?: string, code?: string);
396
+ }
397
+ export declare class ErrorMessage extends Description {
398
+ }
399
+ export type NestedData = {
400
+ [studyEventOID: string]: {
401
+ [studyEventInstance: number]: {
402
+ [formOID: string]: {
403
+ [formInstance: number]: {
404
+ [sectionOID: string]: {
405
+ [sectionInstance: number]: {
406
+ [itemOID: string]: PrimitiveValue;
407
+ };
408
+ };
409
+ };
410
+ };
411
+ };
412
+ };
413
+ };
414
+ export type FieldData = {
415
+ sectionOID: string;
416
+ sectionInstance: number;
417
+ itemOID: string;
418
+ datasetOID: string;
419
+ value?: PrimitiveValue;
420
+ missing?: string;
421
+ verified?: number;
422
+ };
423
+ declare const MissingTypes: {
424
+ readonly "not-available": "NAVU";
425
+ readonly "not-applicable": "NA";
426
+ readonly invalid: "INV";
427
+ readonly "not-asked": "NASK";
428
+ readonly "asked-but-unknown": "ASKU";
429
+ };
430
+ declare const VerifiedTypes: {
431
+ readonly sdv: 1;
432
+ };
433
+ /**
434
+ * While the metadata models very closely reflect the ODM metadata elements, this ItemData
435
+ * flattens the majority of the ODM clinicaldata elements. The reason are fast query executions
436
+ * without the need for expensive joins. On IndexedDB, compound indices allow a precise data
437
+ * query and the naming is in alignment with the ODMPath model. It remains to be evaluated how
438
+ * six relatively long UUIDs affect the indexing process and query performance and whether to
439
+ * switch to an auto-increment approach for those ODM metadata models.
440
+ */
441
+ export declare class ItemData extends DataBlock implements FieldData {
442
+ subject: BlockReference<SubjectData>;
443
+ studyEventOID: string;
444
+ studyEventInstance: number;
445
+ formOID: string;
446
+ formInstance: number;
447
+ sectionOID: string;
448
+ sectionInstance: number;
449
+ itemOID: string;
450
+ datasetOID: string;
451
+ value?: FieldData["value"];
452
+ missing?: typeof MissingTypes[keyof typeof MissingTypes];
453
+ verified?: typeof VerifiedTypes[keyof typeof VerifiedTypes];
454
+ constructor(subject: ItemData["subject"], path?: ODMPath, value?: ItemData["value"]);
455
+ static getHash(data: ItemData[]): Promise<string>;
456
+ static get<T extends PrimitiveValue>(subject: BlockReference<SubjectData>, itemOID: string, projectUUID?: string | undefined): Promise<T | undefined>;
457
+ }
458
+ export declare class StudyEventGroupRef extends DataBlock {
459
+ studyEventGroupDef: StudyEventGroupDef;
460
+ mandatory: "Yes" | "No";
461
+ constructor(studyEventGroupDef: StudyEventGroupDef);
462
+ get def(): StudyEventGroupDef;
463
+ get oid(): string;
464
+ }
465
+ export declare class StudyTiming extends DataBlock {
466
+ oid: string;
467
+ studyEvent: BlockReference<StudyEventDef>;
468
+ predecessor?: BlockReference<StudyEventDef>;
469
+ absoluteTarget?: string;
470
+ relativeTarget?: number;
471
+ preWindow: number;
472
+ postWindow: number;
473
+ constructor(oid: string, studyEvent: BlockReference<StudyEventDef>);
474
+ get timepoints(): string[] | undefined;
475
+ set timepoints(values: string[] | undefined);
476
+ getTimepointsTexts(event?: StudyEventDef): {
477
+ delay: string;
478
+ days: string;
479
+ timepoints: string;
480
+ } | undefined;
481
+ }
482
+ export declare class Protocol extends DataBlock {
483
+ studyEventGroupRefs: StudyEventGroupRef[];
484
+ studyTimings: StudyTiming[];
485
+ }
486
+ export declare class MetaDataVersion extends DataBlock {
487
+ oid: string;
488
+ name: string;
489
+ protocol: Protocol | undefined;
490
+ constructor(oid: string, name?: string);
491
+ getArms(subject?: SubjectData): StudyEventGroupRef[] | undefined;
492
+ get studyEvents(): StudyEventRef[];
493
+ }
494
+ declare const StatusType: {
495
+ readonly INCOMPLETE: 1;
496
+ readonly COMPLETE: 2;
497
+ readonly VERIFIED: 3;
498
+ };
499
+ export declare class FormStatus extends DataBlock {
500
+ subject: BlockReference<SubjectData>;
501
+ studyEventOID: string;
502
+ studyEventInstance: number;
503
+ formOID: string;
504
+ formInstance: number;
505
+ value: typeof StatusType[keyof typeof StatusType];
506
+ locked?: boolean;
507
+ version?: BlockReference<ItemGroupDef>;
508
+ lastUpdateDatetime: number;
509
+ constructor(subject: FormStatus["subject"], version?: FormStatus["version"], path?: ODMPath, value?: FormStatus["value"], locked?: boolean);
510
+ beforeTrigger(): void;
511
+ getImplicitValue(skip?: boolean): 2 | 1 | 5 | 3 | 4;
512
+ static getIcon(value?: FormStatus["value"] | unknown): "circle-half-stroke-solid" | "circle-check-solid" | "badge-check-solid" | "shield-keyhole-solid" | "forward-solid" | "circle-duotone";
513
+ static getType(value?: FormStatus["value"] | unknown): "danger" | "primary" | "success" | undefined;
514
+ static getKey(value?: FormStatus["value"] | unknown): string;
515
+ static getAggregation(states: FormStatus[], originalLength: number): number;
516
+ setValue(form: ItemGroupRef, data: ItemData[], hiddenPaths: string[]): void;
517
+ getStatusByField(form: ItemGroupRef, data: ItemData[], hiddenPaths: string[], skipEmpty?: boolean): Map<ODMPath, number>;
518
+ }
519
+ declare const DefaultFields: {
520
+ readonly environment: "environment";
521
+ readonly location: "location";
522
+ readonly event: "event";
523
+ readonly "event-instance": "event-instance";
524
+ readonly form: "form";
525
+ readonly "form-instance": "form-instance";
526
+ };
527
+ export type ExpressionData = NestedData & {
528
+ [defaultFields in typeof DefaultFields[keyof typeof DefaultFields]]?: string;
529
+ };
530
+ declare const Comparators: {
531
+ readonly GT: ">";
532
+ readonly GE: ">=";
533
+ readonly LT: "<";
534
+ readonly LE: "<=";
535
+ readonly EQ: "==";
536
+ readonly NE: "!=";
537
+ };
538
+ export declare class RangeCheck extends DataBlock {
539
+ comparator?: keyof typeof Comparators;
540
+ checkValue?: string | number;
541
+ formalExpression?: FormalExpression;
542
+ softHard: "Soft" | "Hard";
543
+ errorMessage?: ErrorMessage;
544
+ constructor(comparator?: keyof typeof Comparators, checkValue?: string | number);
545
+ evaluate(value?: PrimitiveValue, siblings?: RangeCheck[], data?: ExpressionData, path?: ODMPath): boolean;
546
+ get logic(): string;
547
+ set logic(value: string);
548
+ get value(): string;
549
+ set value(value: string);
550
+ }
551
+ export type Right = boolean | (string | number)[];
552
+ export declare class Role extends DataBlock {
553
+ name: string;
554
+ description?: string;
555
+ rights: {
556
+ [name: string]: Right;
557
+ };
558
+ constructor(name: string, rights?: Role["rights"]);
559
+ }
560
+ declare class EncryptionKey extends DataBlock {
561
+ owner?: BlockReference<User>;
562
+ credentialId: string;
563
+ encryptedKey: string;
564
+ private static cryptoKeys;
565
+ constructor(owner: BlockReference<User>, credentialId: string, encryptedKey: string, cryptoKey?: CryptoKey);
566
+ get cryptoKey(): Promise<CryptoKey>;
567
+ private unsetCryptoKeys;
568
+ }
569
+ export type TranslationOptions = {
570
+ key: string;
571
+ locale?: string;
572
+ pluralRule?: number;
573
+ interpolation?: Record<string, string | number | undefined>;
574
+ transform?: "upper" | "lower" | "capital" | "decapital" | "date" | "time" | "datetime" | "l10n" | "ref";
575
+ };
576
+ export type Notifications = "announcements" | "message-unread" | "query-assigned" | "subject-created" | "schedule-reached" | "schedule-upcoming" | "schedule-ending";
577
+ export type NotificationVariants = `${Notifications}-${"participant" | "member"}-${"action" | "info"}`;
578
+ declare const NotificationTypes: {
579
+ [type in Notifications]: {
580
+ limitedMethods?: Array<keyof typeof NotificationMethods>;
581
+ };
582
+ };
583
+ declare const NotificationMethods: {
584
+ email: string;
585
+ push: string;
586
+ app: string;
587
+ };
588
+ declare class Notification$1 extends DataBlock {
589
+ recipient?: BlockReference<User>;
590
+ subject?: BlockReference<SubjectData>;
591
+ language?: string;
592
+ type: keyof typeof NotificationTypes;
593
+ toSendBy?: {
594
+ [method in keyof typeof NotificationMethods]?: true;
595
+ } & {
596
+ sms?: true;
597
+ };
598
+ retries: number;
599
+ action?: string;
600
+ values?: TranslationOptions["interpolation"];
601
+ readAt?: number;
602
+ dedupe?: string;
603
+ constructor(recipient: Notification$1["recipient"], language: Notification$1["language"], type: Notification$1["type"], toSendBy: Notification$1["toSendBy"], action: Notification$1["action"], values: Notification$1["values"], dedupe?: Notification$1["dedupe"], subject?: Notification$1["subject"]);
604
+ get variant(): NotificationVariants;
605
+ commitDedupe(project: string): Promise<void>;
606
+ }
607
+ export declare class ProjectUser extends DataBlock {
608
+ user: User | undefined;
609
+ role: Role | undefined;
610
+ locations: BlockReference<Location$1>[];
611
+ participant?: BlockReference<SubjectData>;
612
+ preferredGivenName?: string;
613
+ preferredFamilyName?: string;
614
+ preferredEmail?: string;
615
+ preferredLanguage?: string;
616
+ notifications?: {
617
+ [type in keyof typeof NotificationTypes]?: {
618
+ [method in keyof typeof NotificationMethods]?: true;
619
+ };
620
+ };
621
+ encryptedPrivateProjectKey?: string;
622
+ private encryptionKey?;
623
+ constructor(user?: User, participant?: BlockReference<SubjectData>);
624
+ beforeTrigger(): Promise<void>;
625
+ hasRight(...rights: string[]): boolean;
626
+ inRight(value: string | number, ...rights: string[]): boolean;
627
+ getEncryptionKey(): Promise<EncryptionKey>;
628
+ getDecryptedPrivateProjectKey(): Promise<string>;
629
+ get defaultEmail(): string | undefined;
630
+ get defaultNotifications(): ProjectUser["notifications"];
631
+ get isOwner(): boolean;
632
+ get givenName(): string | undefined;
633
+ get familyName(): string | undefined;
634
+ get email(): string | undefined;
635
+ get language(): string | undefined;
636
+ get fullName(): string | undefined;
637
+ get type(): "team-member" | "study-participant";
638
+ getMemberNameOrSubjectId(subjects?: SubjectData[], options?: SubjectKeyOptions): string | undefined;
639
+ getComboboxEntry(subjects?: SubjectData[], options?: SubjectKeyOptions): {
640
+ value: string;
641
+ content: string;
642
+ };
643
+ }
644
+ export type AtomicConfig = {
645
+ path: string;
646
+ [key: string]: any;
647
+ };
648
+ export declare class ItemDef extends DataBlock implements TranslatedModel {
649
+ oid: string;
650
+ name: string;
651
+ dataType: "string" | "text" | "integer" | "decimal" | "float" | "double" | "boolean" | "date" | "time" | "datetime" | "partialDate" | "email" | "base64Binary" | "URI";
652
+ question: Question;
653
+ description: Description | undefined;
654
+ rangeChecks: RangeCheck[];
655
+ codeListRef: CodeListRef | undefined;
656
+ aliases: Alias[];
657
+ constructor(oid: string, name?: string);
658
+ translatedText(lang?: string, preferName?: boolean): string;
659
+ get fieldName(): any;
660
+ get suitableFields(): AtomicConfig[] | undefined;
661
+ get encryption(): string | undefined;
662
+ set encryption(value: string | undefined);
663
+ get id(): string;
664
+ get texts(): Question;
665
+ }
666
+ export declare class MethodDef extends ConditionDef {
667
+ type?: "Computation" | "Imputation" | "Transpose" | "Preload";
668
+ }
669
+ export declare class ItemRef extends DataBlock {
670
+ itemDef: ItemDef;
671
+ mandatory: "Yes" | "No";
672
+ repeat: "Yes" | undefined;
673
+ unitsItemDef: ItemDef | undefined;
674
+ collectionCondition: ConditionDef | undefined;
675
+ calculationMethod: MethodDef | undefined;
676
+ constructor(itemDef: ItemDef);
677
+ get def(): ItemDef;
678
+ get oid(): string;
679
+ get itemRefs(): this[];
680
+ get itemRef(): this;
681
+ get significantRef(): this;
682
+ }
683
+ declare const FormPurpose: {
684
+ eCRF: string;
685
+ ePRO: string;
686
+ eConsent: string;
687
+ Information: string;
688
+ };
689
+ export declare class ItemGroupDef extends DataBlock {
690
+ oid: string;
691
+ name: string;
692
+ type: "Form" | "Section" | "Dataset" | "Concept";
693
+ repeating: "No" | "Simple" | "Dynamic" | "Static";
694
+ repeatingLimit?: number;
695
+ hasNoData: "Yes" | undefined;
696
+ description: Description;
697
+ itemOrGroupRefs: (ItemGroupRef | ItemRef)[];
698
+ aliases: Alias[];
699
+ purpose?: keyof typeof FormPurpose;
700
+ constructor(oid: string, type: ItemGroupDef["type"], name?: string);
701
+ get formFields(): (ItemGroupRef | ItemRef)[];
702
+ get datasetType(): "choices" | "questions" | undefined;
703
+ get assignedElements(): (ItemGroupRef | ItemRef)[];
704
+ get itemGroupRefs(): ItemGroupRef[];
705
+ get itemRefs(): ItemRef[];
706
+ get fieldName(): any;
707
+ get suitableFields(): AtomicConfig[] | undefined;
708
+ get languages(): string[];
709
+ get firstMatchingLanguage(): string;
710
+ get version(): number | undefined;
711
+ set version(value: number | undefined);
712
+ get headerHeight(): number | undefined;
713
+ set headerHeight(value: number | undefined);
714
+ get headerImage(): string | undefined;
715
+ set headerImage(value: string | undefined);
716
+ private headerUrlPromise?;
717
+ get headerUrl(): Promise<string | undefined>;
718
+ }
719
+ export declare class ItemGroupRef extends DataBlock {
720
+ itemGroupDef: ItemGroupDef;
721
+ mandatory: "Yes" | "No";
722
+ collectionCondition: ConditionDef | undefined;
723
+ constructor(itemGroupDef: ItemGroupDef);
724
+ get def(): ItemGroupDef;
725
+ get oid(): string;
726
+ get itemRefs(): ItemRef[];
727
+ get itemRef(): ItemRef | undefined;
728
+ get significantRef(): ItemGroupRef | ItemRef | undefined;
729
+ get itemDef(): ItemDef | undefined;
730
+ }
731
+ export declare class StudyEventDef extends DataBlock {
732
+ oid: string;
733
+ name: string;
734
+ repeating: "Yes" | "No";
735
+ repeatingLimit?: number;
736
+ type: "Scheduled" | "Unscheduled" | "Common";
737
+ description: Description;
738
+ itemGroupRefs: ItemGroupRef[];
739
+ aliases: Alias[];
740
+ constructor(oid: string);
741
+ get assignedElements(): ItemGroupRef[];
742
+ get referenceDateItemOID(): string | undefined;
743
+ }
744
+ export declare class StudyEventRef extends DataBlock {
745
+ studyEventDef: StudyEventDef;
746
+ mandatory: "Yes" | "No";
747
+ collectionCondition: ConditionDef | undefined;
748
+ constructor(studyEventDef: StudyEventDef);
749
+ get def(): StudyEventDef;
750
+ get oid(): string;
751
+ }
752
+ export declare class StudyEventGroupDef extends DataBlock {
753
+ oid: string;
754
+ name: string;
755
+ description?: Description;
756
+ studyEventRefs: StudyEventRef[];
757
+ aliases: Alias[];
758
+ armOID?: string;
759
+ constructor(oid: string);
760
+ get assignedElements(): StudyEventRef[];
761
+ }
762
+ export declare class SettingData<T extends FieldData["value"]> extends DataBlock implements FieldData {
763
+ moduleName: string;
764
+ sectionOID: string;
765
+ sectionInstance: number;
766
+ itemOID: string;
767
+ datasetOID: string;
768
+ value?: T;
769
+ constructor(moduleName: string, path?: ODMPath, value?: T);
770
+ static get<T extends PrimitiveValue>(itemOID: string, projectUUID?: string | undefined): Promise<T | undefined>;
771
+ }
772
+ export type SubjectKeyOptions = {
773
+ minLengthPadding?: number;
774
+ manualEntryPrefix?: string;
775
+ autoIncrementPrefix?: string;
776
+ locationIdPrefix?: Record<string, string>;
777
+ };
778
+ export declare class SubjectData extends DataBlock {
779
+ subjectKey: string;
780
+ locationCount: number | undefined;
781
+ location: BlockReference<Location$1> | undefined;
782
+ arms: BlockReference<StudyEventGroupDef>[] | undefined;
783
+ constructor(subjectKey?: string, location?: BlockReference<Location$1>);
784
+ beforeTrigger(): Promise<void>;
785
+ getPlainKey(): string;
786
+ getKeyPrefix(options: SubjectKeyOptions): string;
787
+ getId(options: SubjectKeyOptions): string;
788
+ getIdAsync(): Promise<string>;
789
+ static getKeyPrefix(subjectKey: string | undefined, locationUUID: string | undefined, options: SubjectKeyOptions): string;
790
+ static getPlainKey(subjectKey: string | undefined, locationCount: number | undefined): string;
791
+ static getId(subjectKey: string | undefined, locationCount: number | undefined, locationUUID: string | undefined, options: SubjectKeyOptions): string;
792
+ static getSubjectKeyOptions(settings?: SettingData<any>[], locations?: Location$1[]): SubjectKeyOptions;
793
+ static fetchSubjectKeyOptions(projectUUID?: string | undefined): Promise<SubjectKeyOptions>;
794
+ editableBy(user?: ProjectUser, action?: string): boolean | BlockReference<Location$1> | undefined;
795
+ viewableBy(user?: ProjectUser): boolean | BlockReference<Location$1> | undefined;
796
+ }
797
+ export declare class CalendarEvent extends DataBlock {
798
+ owner: BlockReference<User>;
799
+ subject?: BlockReference<SubjectData>;
800
+ studyEventOID?: string;
801
+ studyEventInstance?: number;
802
+ name?: string;
803
+ description?: string;
804
+ private startDateUTC;
805
+ private startTimeUTC?;
806
+ private endDateUTC;
807
+ private endTimeUTC?;
808
+ shared?: boolean;
809
+ constructor(owner: BlockReference<User>, startDate: string);
810
+ get startDate(): string;
811
+ set startDate(value: string);
812
+ get startTime(): string | undefined;
813
+ set startTime(value: string | undefined);
814
+ get endDate(): string;
815
+ set endDate(value: string);
816
+ get endTime(): string | undefined;
817
+ set endTime(value: string | undefined);
818
+ transformISO(direction: "utc-to-locale" | "locale-to-utc", date: string, time?: string): {
819
+ date: string;
820
+ time: string;
821
+ };
822
+ isAllday(referenceDate?: string): boolean | "" | undefined;
823
+ isBetween(referenceDate?: string): boolean | "" | undefined;
824
+ getTime(referenceDate?: string): string | undefined;
825
+ get url(): string | undefined;
826
+ }
827
+ export declare class FileMetadata extends DataBlock {
828
+ fileName: string;
829
+ mimeType: string;
830
+ fileSize: number;
831
+ version: string;
832
+ policyReference?: BlockReference<DataBlock>;
833
+ constructor(file?: File, policyReference?: BlockReference<DataBlock>);
834
+ get megabytes(): string;
835
+ }
836
+ export declare class FileContent extends DataBlock {
837
+ metadata: BlockReference<FileMetadata>;
838
+ base64Binary?: string;
839
+ file?: File | string;
840
+ published: boolean;
841
+ constructor(metadata: BlockReference<FileMetadata>, file: File, published?: boolean);
842
+ beforeTrigger(): Promise<void>;
843
+ upload(callback?: (progress: number) => void): Promise<void>;
844
+ getUrl(expiration?: number): Promise<string>;
845
+ private getTemporaryObjectURL;
846
+ prepareSerialization(): Promise<void>;
847
+ }
848
+ export type SignaturePoints = {
849
+ time: number;
850
+ x: number;
851
+ y: number;
852
+ pressure: number;
853
+ }[][];
854
+ declare const SignatureStatus: {
855
+ readonly SIGNED: 1;
856
+ readonly WITHDRAWN: 2;
857
+ };
858
+ export declare class Signature extends DataBlock {
859
+ signee?: BlockReference<User>;
860
+ form?: BlockReference<FormStatus>;
861
+ signaturePoints?: SignaturePoints | string;
862
+ signatureURL?: string;
863
+ dataHash?: string;
864
+ status: typeof SignatureStatus[keyof typeof SignatureStatus];
865
+ lastUpdateDatetime: number;
866
+ constructor(signee?: BlockReference<User>, form?: BlockReference<FormStatus>, dataHash?: string);
867
+ beforeTrigger(): void;
868
+ }
869
+ export declare class SurveyInstance extends DataBlock {
870
+ id: string;
871
+ active: boolean;
872
+ studyEventInstance: number;
873
+ form: BlockReference<ItemGroupRef>;
874
+ formInstance: number;
875
+ subject?: BlockReference<SubjectData>;
876
+ expirationDate?: number;
877
+ showExistingData?: boolean;
878
+ location?: BlockReference<Location$1>;
879
+ constructor(studyEventInstance: number, form: SurveyInstance["form"], formInstance: number, subject?: SurveyInstance["subject"], location?: SurveyInstance["location"]);
880
+ getUrl(host?: string): string;
881
+ }
882
+ export declare class SurveySession extends DataBlock {
883
+ instance: BlockReference<SurveyInstance>;
884
+ subject?: BlockReference<SubjectData>;
885
+ finished?: boolean;
886
+ constructor(instance: SurveySession["instance"], subject: SurveySession["subject"]);
887
+ }
888
+ export declare class SurveySettings extends DataBlock {
889
+ form: BlockReference<ItemGroupRef>;
890
+ autoContinueForm: boolean;
891
+ multipleAnswers: boolean;
892
+ defaultExpirationTime?: number;
893
+ defaultShowExistingData?: boolean;
894
+ customColor?: string;
895
+ constructor(form: SurveySettings["form"]);
896
+ }
897
+ export declare class DocumentMetadata extends DataBlock {
898
+ type: "folder" | "document";
899
+ name?: string;
900
+ parent?: BlockReference<DocumentMetadata>;
901
+ constructor(type: DocumentMetadata["type"], parent?: DocumentMetadata["parent"]);
902
+ }
903
+ export declare class DocumentVersion extends DataBlock {
904
+ metadata: BlockReference<DocumentMetadata>;
905
+ major: number;
906
+ minor: number;
907
+ status: "draft" | "version";
908
+ name?: string;
909
+ lang?: string;
910
+ constructor(metadata: BlockReference<DocumentMetadata>, major: number, minor: number, name?: string);
911
+ get full(): string;
912
+ get text(): string;
913
+ static createVersion(metadata: BlockReference<DocumentMetadata>, major: number, minor: number, file?: File, content?: string, name?: string): Promise<DocumentVersion>;
914
+ }
915
+ export declare class DocumentContent extends DataBlock {
916
+ version: BlockReference<DocumentVersion>;
917
+ html?: string;
918
+ file?: BlockReference<FileContent>;
919
+ constructor(version: BlockReference<DocumentVersion>, html?: string, file?: BlockReference<FileContent>);
920
+ getFileData(): Promise<{
921
+ mimeType: string;
922
+ objectURL: string;
923
+ } | undefined>;
924
+ }
925
+ export declare class Study extends DataBlock {
926
+ oid: string;
927
+ studyName: string;
928
+ protocolName: string;
929
+ description: Description;
930
+ metaDataVersions: MetaDataVersion[];
931
+ constructor(oid: string, studyName: string, protocolName: string);
932
+ }
933
+ export declare class ODM extends DataBlock {
934
+ fileOID: string;
935
+ fileType: "Snapshot" | "Transactional" | "Query";
936
+ creationDateTime: Date;
937
+ odmVersion: string;
938
+ description?: Description;
939
+ studies: Study[];
940
+ adminData: undefined;
941
+ clinicalData: undefined;
942
+ sourceSystem: string;
943
+ sourceSystemVersion: any;
944
+ constructor(fileOID: string);
945
+ get metaDataVersion(): MetaDataVersion | undefined;
946
+ }
947
+ declare const QueryStates: {
948
+ readonly OPEN: "Open";
949
+ readonly ANSWERED: "Answered";
950
+ readonly RESOLVED: "Resolved";
951
+ readonly CANCELLED: "Cancelled";
952
+ };
953
+ declare const QueryTypes: {
954
+ readonly MANUAL: "Manual";
955
+ readonly SYSTEM: "System";
956
+ };
957
+ declare const QueryPriorities: {
958
+ readonly LOW: 1;
959
+ readonly MEDIUM: 2;
960
+ readonly HIGH: 3;
961
+ };
962
+ export declare class DataQuery extends DataBlock {
963
+ oid: string;
964
+ name: string;
965
+ value: string;
966
+ owner?: BlockReference<User>;
967
+ subject?: BlockReference<SubjectData>;
968
+ studyEventOID: string;
969
+ studyEventInstance: number;
970
+ formOID: string;
971
+ formInstance: number;
972
+ sectionOID: string;
973
+ sectionInstance: number;
974
+ itemOID: string;
975
+ datasetOID: string;
976
+ state: typeof QueryStates[keyof typeof QueryStates];
977
+ responsible?: BlockReference<User>;
978
+ type: typeof QueryTypes[keyof typeof QueryTypes];
979
+ lastUpdateDatetime: number;
980
+ involved: BlockReference<User>[];
981
+ priority: typeof QueryPriorities[keyof typeof QueryPriorities];
982
+ dueDate?: string;
983
+ constructor(oid: string, owner?: BlockReference<User>, subject?: BlockReference<SubjectData>, path?: ODMPath);
984
+ get isNew(): boolean;
985
+ nextStates(user: ProjectUser): ("Open" | "Answered" | "Resolved" | "Cancelled")[];
986
+ beforeTrigger(): void;
987
+ mayBeEditedBy(user: ProjectUser): boolean;
988
+ static isPending(value: DataQuery["state"] | unknown): boolean;
989
+ }
990
+ declare const RandomizationStatus: {
991
+ readonly draft: "draft";
992
+ readonly review: "review";
993
+ readonly confirmed: "confirmed";
994
+ };
995
+ export declare class RandomizationInfo extends DataBlock {
996
+ status: keyof typeof RandomizationStatus;
997
+ stratification: {
998
+ location?: boolean;
999
+ itemOIDs?: string[];
1000
+ };
1001
+ }
1002
+ export declare class RandomizationSchedule extends DataBlock {
1003
+ plan: BlockReference<RandomizationPlan>;
1004
+ order: number;
1005
+ block: number;
1006
+ subjectKey: number;
1007
+ studyArm: BlockReference<StudyEventGroupDef>;
1008
+ stratification?: {
1009
+ locationUUID?: string;
1010
+ [itemOID: string]: string | undefined;
1011
+ };
1012
+ assignedSubject?: BlockReference<SubjectData>;
1013
+ constructor(plan: RandomizationSchedule["plan"], order: number, block: number, subjectKey: number, studyArm: RandomizationSchedule["studyArm"]);
1014
+ static randomizeSubject(info: RandomizationPlan["info"], subject: SubjectData): Promise<void>;
1015
+ }
1016
+ declare const RandomizationMethods: {
1017
+ "simple-randomization": {
1018
+ blocks: false;
1019
+ strata: false;
1020
+ };
1021
+ "permuted-block-randomization": {
1022
+ blocks: true;
1023
+ strata: false;
1024
+ };
1025
+ "stratified-block-randomization": {
1026
+ blocks: true;
1027
+ strata: true;
1028
+ };
1029
+ };
1030
+ export declare class RandomizationPlan extends DataBlock {
1031
+ version: number;
1032
+ info: RandomizationInfo;
1033
+ arms: {
1034
+ [studyEventGroupOID: string]: {
1035
+ decode: string;
1036
+ ratio: number;
1037
+ };
1038
+ };
1039
+ methods: {
1040
+ type: keyof typeof RandomizationMethods;
1041
+ blockSizes?: number[];
1042
+ };
1043
+ subjects: {
1044
+ number: number;
1045
+ start: number;
1046
+ };
1047
+ beforeTrigger(): void;
1048
+ get ratioSum(): number;
1049
+ get blockSum(): number;
1050
+ generateRandomizationSchedule(metadata: MetaDataVersion, locations: Location$1[]): Promise<RandomizationSchedule[]>;
1051
+ private getStratificationGroups;
1052
+ private getShuffledSubjectKeys;
1053
+ private getShuffledArmOIDsByRatio;
1054
+ }
1055
+ export type FieldItemReference = {
1056
+ defaultFields?: string[];
1057
+ formFields?: string[];
1058
+ formPaths?: string[];
1059
+ odmPaths?: string[];
1060
+ };
1061
+ declare const ProcessingMethods: Record<string, {
1062
+ evaluate: (type: ItemDef["dataType"], scale: "categorical" | "quantitative" | "discrete") => boolean;
1063
+ aggregation?: (values: (string | number)[]) => number;
1064
+ binning?: {
1065
+ transform: (value: string, translate?: boolean) => string;
1066
+ bins?: (translate?: boolean) => string[];
1067
+ };
1068
+ }>;
1069
+ export declare class ChartSettings extends DataBlock {
1070
+ description?: string;
1071
+ chartName: string;
1072
+ dimensions: {
1073
+ [name: string]: FieldItemReference;
1074
+ };
1075
+ processing: {
1076
+ [field: string]: keyof typeof ProcessingMethods;
1077
+ };
1078
+ size: "small" | "medium" | "large";
1079
+ constructor(chartName: string);
1080
+ get config(): AtomicConfig | undefined;
1081
+ }
1082
+ export declare class ReportSettings extends DataBlock {
1083
+ name?: string;
1084
+ owner: BlockReference<User>;
1085
+ sharedUsers: BlockReference<User>[];
1086
+ location?: BlockReference<Location$1>;
1087
+ filters: ChartSettings[];
1088
+ charts: ChartSettings[];
1089
+ translateTexts: boolean;
1090
+ shared: boolean;
1091
+ constructor(owner: BlockReference<User>, translateTexts: boolean);
1092
+ }
1093
+ declare class ShareableBlock extends DataBlock {
1094
+ owner: BlockReference<User>;
1095
+ sharedWithMembers?: boolean;
1096
+ sharedWithParticipants?: boolean;
1097
+ locationsFilter?: BlockReference<Location$1>[];
1098
+ usersFilter?: BlockReference<User>[];
1099
+ collaborators?: BlockReference<User>[];
1100
+ constructor(owner: BlockReference<User>);
1101
+ get explicitUsers(): BlockReference<User>[];
1102
+ userHasAccess(user?: ProjectUser, subjects?: SubjectData[]): boolean | undefined;
1103
+ userMayEdit(user?: ProjectUser): boolean | undefined;
1104
+ usersLocationFilter(user?: ProjectUser, subjects?: SubjectData[]): boolean | undefined;
1105
+ }
1106
+ export declare class MessengerChannel extends ShareableBlock {
1107
+ title?: string;
1108
+ getLocalizedTitle(users?: ProjectUser[], locations?: Location$1[], subjects?: SubjectData[], options?: SubjectKeyOptions, locale?: string): string;
1109
+ }
1110
+ export declare class ChannelMessage extends DataBlock {
1111
+ channel: BlockReference<MessengerChannel>;
1112
+ author: BlockReference<User>;
1113
+ text: string;
1114
+ constructor(channel: BlockReference<MessengerChannel>, author: BlockReference<User>, text: string);
1115
+ }
1116
+ export declare class ChannelStatus extends DataBlock {
1117
+ channel: BlockReference<MessengerChannel>;
1118
+ owner: BlockReference<User>;
1119
+ lastReadMessageUUID?: string;
1120
+ notificationForMessageUUID?: string;
1121
+ constructor(channel: BlockReference<MessengerChannel>, owner: BlockReference<User>);
1122
+ }
1123
+ export type LoginParameters = {
1124
+ serverUrl: string;
1125
+ apiKey: string;
1126
+ };
1127
+ export declare const login: ({ serverUrl, apiKey }: LoginParameters) => Promise<User>;
1128
+ export declare const logout: () => Promise<void>;
1129
+ export declare const scope: (project: Project) => void;
1130
+
1131
+ export {
1132
+ Location$1 as Location,
1133
+ Notification$1 as Notification,
1134
+ };
1135
+
1136
+ export {};