import * as Ro from './ro-interfaces'; import * as RoCustom from './ro-interfaces-custom'; import { Dictionary } from 'lodash'; export declare class Extensions { private wrapped; constructor(wrapped: RoCustom.ICustomExtensions); friendlyName: () => string; description: () => string; returnType: () => string; optional: () => boolean; hasParams: () => boolean; elementType: () => string; domainType: () => string; pluralName: () => string; format: () => Ro.FormatType; memberOrder: () => number; isService: () => boolean; minLength: () => number; maxLength: () => number; pattern: () => string; choices: () => { [index: string]: Ro.ValueType[]; }; menuPath: () => string; mask: () => string; tableViewTitle: () => boolean; tableViewColumns: () => string[]; multipleLines: () => number; warnings: () => string[]; messages: () => string[]; interactionMode: () => string; dataType: () => string; range: () => RoCustom.IRange; notNavigable: () => boolean; renderEagerly: () => boolean; presentationHint: () => string; } export interface IHasExtensions { extensions(): Extensions; } export interface IHasActions extends IHasExtensions { etagDigest?: string; actionMembers(): Dictionary; actionMember(id: string): ActionMember; hasActionMember(id: string): boolean; } export interface IHasLinksAsValue { value(): Link[] | null; } export declare function withNull(v: T | undefined | null): T | null; export declare function withUndefined(v: T | undefined | null): T | undefined; export declare function checkNotNull(v: T | undefined | null): T; export declare function toDateString(dt: Date): string; export declare function toDateTimeString(dt: Date): string; export declare function toTimeString(dt: Date): string; export declare function getTime(rawTime: string): Date | null; export declare function isDate(rep: IHasExtensions): boolean; export declare function isDateTime(rep: IHasExtensions): boolean; export declare function isDateOrDateTime(rep: IHasExtensions): boolean; export declare function isTime(rep: IHasExtensions): boolean; export declare function toTime(value: Value): Date; export declare function toUtcDate(value: Value): Date; export declare function getUtcDate(rawDate: string): Date | null; export declare function compress(toCompress: string, shortCutMarker: string, urlShortCuts: string[]): string; export declare function decompress(toDecompress: string, shortCutMarker: string, urlShortCuts: string[]): string; export declare function getClassName(obj: any): string; export declare function typeFromUrl(url: string): string; export declare function idFromUrl(href: string): string; export declare function propertyIdFromUrl(href: string): string; export declare function friendlyTypeName(fullName: string): string; export declare function friendlyNameForParam(action: ActionRepresentation | InvokableActionMember, parmId: string): string; export declare function friendlyNameForProperty(obj: DomainObjectRepresentation, propId: string): string; export declare function typePlusTitle(obj: DomainObjectRepresentation): string; export declare function isResourceRepresentation(object: any): object is Ro.IResourceRepresentation; export declare function isErrorRepresentation(object: any): object is Ro.IErrorRepresentation; export declare function isIDomainObjectRepresentation(object: any): object is Ro.IDomainObjectRepresentation; export interface IHateoasModel { keySeparator: string; etagDigest?: string; hateoasUrl: string; method: Ro.HttpMethodsType; populate(wrapped: Ro.IRepresentation): void; getBody(): Ro.IRepresentation; getUrl(): string; } export declare enum ErrorCategory { HttpClientError = 0, HttpServerError = 1, ClientError = 2, } export declare enum HttpStatusCode { NoContent = 204, BadRequest = 400, Unauthorized = 401, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, PreconditionFailed = 412, UnprocessableEntity = 422, PreconditionRequired = 428, InternalServerError = 500, } export declare enum ClientErrorCode { ExpiredTransient = 0, WrongType = 1, NotImplemented = 2, SoftwareError = 3, ConnectionProblem = 0, } export declare class ErrorWrapper { readonly category: ErrorCategory; readonly originalUrl: string; constructor(category: ErrorCategory, code: HttpStatusCode | ClientErrorCode, err: string | ErrorMap | ErrorRepresentation, originalUrl?: string); title: string; description: string; errorCode: string; httpErrorCode: HttpStatusCode; clientErrorCode: ClientErrorCode; message: string; error: ErrorMap | ErrorRepresentation | null; stackTrace: string[]; handled: boolean; } export declare class ObjectIdWrapper { private readonly keySeparator; domainType: string; instanceId: string; splitInstanceId: string[]; isService: boolean; static safeSplit(id: string, keySeparator: string): string[]; static fromObject(object: DomainObjectRepresentation): ObjectIdWrapper; static fromLink(link: Link, keySeparator: string): ObjectIdWrapper; static fromHref(href: string, keySeparator: string): ObjectIdWrapper; static fromObjectId(objectId: string, keySeparator: string): ObjectIdWrapper; static fromRaw(dt: string, id: string, keySeparator: string): ObjectIdWrapper; static fromSplitRaw(dt: string, id: string[], keySeparator: string): ObjectIdWrapper; constructor(keySeparator: string); getKey(): string; isSame(other: ObjectIdWrapper): boolean; } export declare abstract class HateosModel implements IHateoasModel { protected model: Ro.IRepresentation; etagDigest?: string; hateoasUrl: string; method: Ro.HttpMethodsType; urlParms: Dictionary; keySeparator: string; protected constructor(model?: Ro.IRepresentation); populate(model: Ro.IRepresentation): void; getBody(): Ro.IRepresentation; getUrl(): string; setUrlParameter(name: string, value: Object): void; } export declare abstract class ArgumentMap extends HateosModel { valueMap: Ro.IValueMap; id: string; protected constructor(valueMap: Ro.IValueMap, id: string); populate(wrapped: Ro.IValueMap): void; } export declare abstract class NestedRepresentation { private model; private lazyLinks; private lazyExtensions; protected resource: () => T; protected constructor(model: T); links(): Link[]; protected update(newResource: T): void; extensions(): Extensions; } export declare class RelParm { asString: string; name: string | undefined; value: string | undefined; constructor(asString: string); private decomposeParm(); } export declare class Rel { asString: string; ns: string; uniqueValue: string; parms: RelParm[]; constructor(asString: string); private decomposeRel(); } export declare class MediaType { asString: string; applicationType: string; profile: string; xRoDomainType: string; representationType: string; domainType: string; constructor(asString: string); private decomposeMediaType(); } export declare class Value { private wrapped; constructor(raw: Link | (Link | Ro.ValueType | Value)[] | Ro.ValueType | Blob | Value); static fromJsonString(jsonString: string, shortCutMarker: string, urlShortCuts: string[]): Value; isBlob(): boolean; isScalar(): boolean; isReference(): boolean; isFileReference(): boolean; isList(): boolean; isNull(): boolean; blob(): Blob | null; link(): Link | null; getHref(): string | null; scalar(): Ro.ScalarValueType; list(): Value[] | null; toString(): string; private compress(shortCutMarker, urlShortCuts); private decompress(shortCutMarker, urlShortCuts); toValueString(): string; toJsonString(shortCutMarker: string, urlShortCuts: string[]): string; setValue(target: Ro.IValue): void; set(target: Dictionary, name: string): void; } export declare class ErrorValue { value: Value; invalidReason: string | null; constructor(value: Value, invalidReason: string | null); } export declare class Result { readonly wrapped: Ro.IDomainObjectRepresentation | RoCustom.ICustomListRepresentation | Ro.IScalarValueRepresentation | null; private readonly resultType; constructor(wrapped: Ro.IDomainObjectRepresentation | RoCustom.ICustomListRepresentation | Ro.IScalarValueRepresentation | null, resultType: Ro.ResultTypeType); object(): DomainObjectRepresentation | null; list(): ListRepresentation | null; scalar(): ScalarValueRepresentation | null; isNull(): boolean; isVoid(): boolean; } export declare class ErrorMap { private readonly valueMap; statusCode: number; warningMessage: string; wrapped: () => Ro.IValueMap; constructor(valueMap: Ro.IValueMap | Ro.IObjectOfType, statusCode: number, warningMessage: string); valuesMap(): Dictionary; invalidReason(): string; containsError(): boolean; } export declare class UpdateMap extends ArgumentMap implements IHateoasModel { private readonly domainObject; constructor(domainObject: DomainObjectRepresentation, valueMap: Ro.IValueMap); properties(): Dictionary; setProperty(name: string, value: Value): void; setValidateOnly(): void; } export declare class AddToRemoveFromMap extends ArgumentMap implements IHateoasModel { private readonly collectionResource; constructor(collectionResource: CollectionRepresentation, valueMap: Ro.IValueMap, add: boolean); } export declare class ModifyMap extends ArgumentMap implements IHateoasModel { private readonly propertyResource; constructor(propertyResource: PropertyRepresentation | PropertyMember, valueMap: Ro.IValueMap); } export declare class ClearMap extends ArgumentMap implements IHateoasModel { constructor(propertyResource: PropertyRepresentation | PropertyMember); } export declare abstract class ResourceRepresentation extends HateosModel { private lazyExtensions; private lazyLinks; protected resource: () => T; links(): Link[]; populate(wrapped: T): void; extensions(): Extensions; } export declare class InvokeMap extends ArgumentMap implements IHateoasModel { private readonly link; constructor(link: Link); setParameter(name: string, value: Value): void; } export declare class ActionResultRepresentation extends ResourceRepresentation { wrapped: () => Ro.IActionInvokeRepresentation; constructor(); selfLink(): Link | null; getSelf(): ActionResultRepresentation | null; resultType(): Ro.ResultTypeType; result(): Result; warningsOrMessages(): string | undefined; shouldExpectResult(): boolean; } export interface IField extends IHasExtensions { id(): string; choices(): Dictionary | null; isScalar(): boolean; isCollectionContributed(): boolean; entryType(): EntryType; getPromptMap(): PromptMap | null; promptLink(): Link | null; } export declare class Parameter extends NestedRepresentation implements IField { parent: ActionMember | ActionRepresentation; private readonly paramId; wrapped: () => Ro.IParameterRepresentation; constructor(wrapped: Ro.IParameterRepresentation, parent: ActionMember | ActionRepresentation, paramId: string); id(): string; choices(): Dictionary | null; promptLink(): Link | null; getPromptMap(): PromptMap | null; default(): Value; isScalar(): boolean; isList(): boolean; private hasPrompt(); isCollectionContributed(): boolean; private hasChoices(); entryType(): EntryType; } export declare class ActionRepresentation extends ResourceRepresentation { private parameterMap; parent: IHasActions; wrapped: () => Ro.IActionRepresentation; selfLink(): Link; upLink(): Link; invokeLink(): Link | null; getSelf(): ActionRepresentation; getUp(): DomainObjectRepresentation; getInvokeMap(): InvokeMap | null; actionId(): string; private initParameterMap(); parameters(): Dictionary; disabledReason(): string; isQueryOnly(): boolean; isNotQueryOnly(): boolean; isPotent(): boolean; } export declare class PromptMap extends ArgumentMap implements IHateoasModel { private readonly link; private readonly promptId; constructor(link: Link, promptId: string); private promptMap(); setSearchTerm(term: string): void; setArgument(name: string, val: Value): void; setArguments(args: Dictionary): void; setMember(name: string, value: Value): void; setMembers(objectValues: () => Dictionary): void; } export declare class PromptRepresentation extends ResourceRepresentation { wrapped: () => Ro.IPromptRepresentation; constructor(); selfLink(): Link; upLink(): Link; getSelf(): PromptRepresentation; getUp(): DomainObjectRepresentation; instanceId(): string; choices(addEmpty: boolean): Dictionary | null; } export declare class CollectionRepresentation extends ResourceRepresentation implements IHasActions { private actionMemberMap; private lazyValue; wrapped: () => RoCustom.ICustomCollectionRepresentation; selfLink(): Link; upLink(): Link; addToLink(): Link | null; removeFromLink(): Link | null; getSelf(): CollectionRepresentation; getUp(): DomainObjectRepresentation; setFromMap(addToRemoveFromMap: AddToRemoveFromMap): void; private addToMap(); getAddToMap(): AddToRemoveFromMap | null; private removeFromMap(); getRemoveFromMap(): AddToRemoveFromMap | null; collectionId(): string; size(): number; value(): Link[]; disabledReason(): string; hasTableData: () => boolean; actionMembers(): Dictionary; actionMember(id: string): ActionMember; hasActionMember(id: string): boolean; } export declare class PropertyRepresentation extends ResourceRepresentation { wrapped: () => Ro.IPropertyRepresentation; modifyLink(): Link | null; clearLink(): Link | null; selfLink(): Link; upLink(): Link; promptLink(): Link | null; private modifyMap(); getSelf(): PropertyRepresentation; getUp(): DomainObjectRepresentation; setFromModifyMap(modifymap: ModifyMap): void; getModifyMap(): ModifyMap | null; getClearMap(): ClearMap | null; instanceId(): string; value(): Value; choices(): Dictionary | null; disabledReason(): string; isScalar(): boolean; hasPrompt(): boolean; } export declare class Member extends NestedRepresentation { constructor(wrapped: T); static wrapLinkMember(toWrap: Ro.IPropertyMember | Ro.ICollectionMember, parent: Link, id: string): PropertyMember | CollectionMember; static wrapMember(toWrap: Ro.IPropertyMember | Ro.ICollectionMember | Ro.IActionMember, parent: DomainObjectRepresentation | IHasActions, id: string): Member; wrapped: () => Ro.IMember; update(newValue: Ro.IMember): void; memberType(): Ro.MemberTypeType; detailsLink(): Link | null; disabledReason(): string; isScalar(): boolean; } export declare class PropertyMember extends Member implements IField { parent: DomainObjectRepresentation | Link; private readonly propId; wrapped: () => Ro.IPropertyMember; constructor(wrapped: Ro.IPropertyMember, parent: DomainObjectRepresentation | Link, propId: string); id(): string; modifyLink(): Link | null; clearLink(): Link | null; private modifyMap(); setFromModifyMap(modifyMap: ModifyMap): void; getModifyMap(id: string): ModifyMap | null; getClearMap(id: string): ClearMap | null; getPromptMap(): PromptMap | null; value(): Value; isScalar(): boolean; attachmentLink(): Link | null; promptLink(): Link | null; getDetails(): PropertyRepresentation | null; private hasChoices(); private hasPrompt(); choices(): Dictionary | null; private hasConditionalChoices(); isCollectionContributed(): boolean; entryType(): EntryType; } export declare class CollectionMember extends Member implements IHasLinksAsValue, IHasActions { parent: DomainObjectRepresentation | Link; private readonly id; private lazyValue; private actionMemberMap; etagDigest?: string; wrapped: () => RoCustom.ICustomCollectionMember; constructor(wrapped: Ro.ICollectionMember, parent: DomainObjectRepresentation | Link, id: string); collectionId(): string; value(): Link[] | null; size(): number | null; getDetails(): CollectionRepresentation | null; hasTableData: () => boolean; actionMembers(): Dictionary; hasActionMember(id: string): boolean; actionMember(id: string): ActionMember; } export declare class ActionMember extends Member { parent: IHasActions; private readonly id; wrapped: () => Ro.IActionMember; constructor(wrapped: Ro.IActionMember, parent: IHasActions, id: string); actionId(): string; getDetails(): ActionRepresentation | null; invokeLink(): Link | null; disabledReason(): string; } export declare class InvokableActionMember extends ActionMember { private parameterMap; constructor(wrapped: Ro.IActionMember, parent: IHasActions, id: string); getInvokeMap(): InvokeMap | null; isQueryOnly(): boolean; isNotQueryOnly(): boolean; isPotent(): boolean; private initParameterMap(); parameters(): Dictionary; } export declare class DomainObjectRepresentation extends ResourceRepresentation implements IHasActions { private memberMap; private propertyMemberMap; private collectionMemberMap; private actionMemberMap; private oid; wrapped: () => Ro.IDomainObjectRepresentation; constructor(model?: Ro.IRepresentation); id(): string; title(): string; domainType(): string | null; serviceId(): string | null; instanceId(): string | null; private resetMemberMaps(); private initMemberMaps(); members(): Dictionary>; propertyMembers(): Dictionary; collectionMembers(): Dictionary; actionMembers(): Dictionary; member(id: string): Member; propertyMember(id: string): PropertyMember; collectionMember(id: string): CollectionMember; hasActionMember(id: string): boolean; actionMember(id: string): ActionMember; updateLink(): Link | null; isTransient(): boolean; persistLink(): Link | null; selfLink(): Link | null; private updateMap(); private persistMap(); getSelf(): DomainObjectRepresentation; getPersistMap(): PersistMap; getUpdateMap(): UpdateMap; setInlinePropertyDetails(flag: boolean): void; getOid(): ObjectIdWrapper; updateSelfLinkWithTitle(): Link; } export declare class MenuRepresentation extends ResourceRepresentation implements IHasActions { private memberMap; private actionMemberMap; wrapped: () => RoCustom.IMenuRepresentation; constructor(); title(): string; menuId(): string; private resetMemberMaps(); private initMemberMaps(); members(): Dictionary>; actionMembers(): Dictionary; member(id: string): Member; hasActionMember(id: string): boolean; actionMember(id: string): ActionMember; selfLink(): Link; getSelf(): MenuRepresentation; } export declare class ScalarValueRepresentation extends NestedRepresentation { wrapped: () => Ro.IScalarValueRepresentation; constructor(wrapped: Ro.IScalarValueRepresentation); value(): Value; } export declare class ListRepresentation extends ResourceRepresentation implements IHasLinksAsValue, IHasActions { private actionMemberMap; private lazyValue; constructor(model?: Ro.IRepresentation); wrapped: () => RoCustom.ICustomListRepresentation; selfLink(): Link; getSelf(): ListRepresentation; value(): Link[]; pagination(): RoCustom.IPagination | null; actionMembers(): Dictionary; actionMember(id: string): ActionMember; hasActionMember(id: string): boolean; hasTableData: () => boolean; } export interface IErrorDetails { message(): string; stackTrace(): string[]; } export declare class ErrorRepresentation extends ResourceRepresentation implements IErrorDetails { constructor(); static create(message: string, stackTrace?: string[], causedBy?: Ro.IErrorDetailsRepresentation): ErrorRepresentation; wrapped: () => Ro.IErrorRepresentation; message(): string; stackTrace(): string[]; causedBy(): IErrorDetails | undefined; } export declare class PersistMap extends HateosModel implements IHateoasModel { private readonly domainObject; private readonly objectOfType; constructor(domainObject: DomainObjectRepresentation, objectOfType: Ro.IObjectOfType); setMember(name: string, value: Value): void; setValidateOnly(): void; } export declare class VersionRepresentation extends ResourceRepresentation { wrapped: () => Ro.IVersionRepresentation; selfLink(): Link; upLink(): Link; getSelf(): VersionRepresentation; getUp(): HomePageRepresentation; specVersion(): string; implVersion(): string | null; optionalCapabilities(): Ro.IOptionalCapabilities; } export declare class DomainServicesRepresentation extends ListRepresentation { wrapped: () => RoCustom.ICustomListRepresentation; upLink(): Link; getSelf(): DomainServicesRepresentation; getUp(): HomePageRepresentation; getService(serviceType: string): DomainObjectRepresentation; } export declare class MenusRepresentation extends ListRepresentation { wrapped: () => RoCustom.ICustomListRepresentation; upLink(): Link; getSelf(): MenusRepresentation; getUp(): HomePageRepresentation; getMenu(menuId: string): MenuRepresentation; } export declare class UserRepresentation extends ResourceRepresentation { wrapped: () => Ro.IUserRepresentation; selfLink(): Link; upLink(): Link; getSelf(): UserRepresentation; getUp(): HomePageRepresentation; userName(): string; friendlyName(): string; email(): string; roles(): string[]; } export declare class DomainTypeActionInvokeRepresentation extends ResourceRepresentation { wrapped: () => Ro.IDomainTypeActionInvokeRepresentation; constructor(againstType: string, toCheckType: string, appPath: string); selfLink(): Link; getSelf(): DomainTypeActionInvokeRepresentation; id(): string; value(): boolean; } export declare class HomePageRepresentation extends ResourceRepresentation { constructor(rep: Ro.IRepresentation, appPath: string); wrapped: () => Ro.IHomePageRepresentation; serviceLink(): Link; userLink(): Link; selfLink(): Link; versionLink(): Link; menusLink(): Link; getSelf(): HomePageRepresentation; getUser(): UserRepresentation; getDomainServices(): DomainServicesRepresentation; getVersion(): VersionRepresentation; getMenus(): MenusRepresentation; } export declare class Link { wrapped: Ro.ILink; private oid; private lazyExtensions; private repTypeToModel; constructor(wrapped: Ro.ILink); compress(shortCutMarker: string, urlShortCuts: string[]): Link; decompress(shortCutMarker: string, urlShortCuts: string[]): Link; href(): string; method(): Ro.HttpMethodsType; rel(): Rel; type(): MediaType; title(): string | null; setTitle(title: string): void; arguments(): Ro.IValue | Ro.IValueMap | Ro.IObjectOfType | Ro.IPromptMap | null; members(): Dictionary | null; extensions(): Extensions; copyToHateoasModel(hateoasModel: IHateoasModel): void; private getHateoasTarget(targetType); getTarget(): IHateoasModel; getTargetAs(): T; getOid(keySeparator: string): ObjectIdWrapper; } export declare enum EntryType { FreeForm = 0, Choices = 1, MultipleChoices = 2, ConditionalChoices = 3, MultipleConditionalChoices = 4, AutoComplete = 5, File = 6, }