import { TypeDescriptor, FieldDescriptor, Grants, UUID } from 'ozone-type'; export declare type TypeDescriptorCollection = Map>; /** * `ozone-api-type` is low level polymer module to ozone type. * It provide read operation on collection type. * * By default it create a instance of OzoneApiType in the dom. * You can retrieve the default ItemApi with *getOzoneApiType* * * * Example in html * ```html * * ``` * * Example in javaScript * ```javaScript * const ozoneTypeAPI = getOzoneApiType(); // return instance of OzoneApiType located in the dom * ``` */ export declare class OzoneApiType { constructor(); /** * collection type. * @value: item */ collection: string; /** * cached value of types */ typeCached: TypeDescriptorCollection; /** * * @private */ _typeDescriptor: Promise | null; /** * Load api type description form ozone and set typeDescriptor attribute. * * @return {Promise} */ loadType(collection?: string): Promise; /** * * @private */ _getRequest(url: string): Promise; _postRequest(url: string, body: any): Promise; /** * get list of fields of the collection. * @return {Promise>} list of field */ getFields(collection?: string): Promise>; /** * * @private */ _buildTypeUrl(collection: string): Promise; /** * * @private */ _buildPermissionsUrl(fields: Array): Promise; /** * will set TypeDescriptor for the given collection in typeCached. * @param collection * @return {Promise} promise resolve with collection of typeDescription cached. */ setType(collection: string): Promise; /** * retrieve TypeDescriptor of the given collection * @param collection * @return {TypeDescriptor} */ getType(collection: string): Promise; /** * find FieldDescriptor of a field in a given collection. * It will look in parent if needed. * @param collection * @param field * @return {Promise} */ findFieldInCollection(collection: string, field: string): Promise; getAllFields(collection: string): Promise>; ifIsTypeInstanceOf(currentType: string, instance: string): Promise; isFildEditable(): Promise; getPermissions(fields: Array, id: UUID): Promise; } export declare class FieldsPermission { grant: Grants; isFieldEditable(fieldName: string): boolean; constructor(grant: Grants); } /** * return OzoneApiType singleton * @type {()=>OzoneApiItem} */ export declare const getOzoneApiType: () => OzoneApiType;