UNPKG

ithit.webdav.server

Version:

With IT Hit WebDAV Server Engine for Node.js you can create your own WebDAV server, add WebDAV support to your existing Node.js project or DAV-enable your CMS/DMS/CRM.

43 lines (42 loc) 1.79 kB
import { DavContextBase } from "../DavContextBase"; import { IHierarchyItem } from "../IHierarchyItem"; /** * @copyright Copyright (c) 2017 IT Hit. All rights reserved. */ /** * Provides point of extension to PROPFIND, PROPPATCH requests. * @remarks If you need to implement your own live property, * implement this interface and register it with {@link DavEngine.registerPropertyHandler} method. * Engine will call this handler when it needs to read/write the property. */ export interface IPropertyHandler { /** * Gets a value indicating whether the property is readonly and cannot be updated. */ isReadonly: boolean; /** * Gets a value indicating whether the property shall be included in 'allprop' response. */ includeInAllProp: boolean; /** * Writes property value to xml writer. * @param item Item for which to retrieve property. * @param context Context. * @remarks Property writer shall retrieve and validate all values first and only then write anything to writer. * Otherwise exception may be thrown while retrieving properties and output XML will be broken. */ write(writer: any, item: IHierarchyItem, context: DavContextBase): void; /** * Updates value of property. * @param context Context. * @param item Item in which to update property. * @param value Xml with property value. */ update(context: DavContextBase, item: IHierarchyItem, value: Element): void; /** * Determines whether this property can be set/retrieved form an item. * @param item Item to determine whether property applies to it. * @returns true if the property applies to the item. */ appliesTo(item: IHierarchyItem): boolean; }