smartexpose/ts/classes.smartexpose.ts

34 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-04-22 11:13:00 +00:00
import type { ExposeProvider } from './classes.exposeprovider.js';
import { WebDavExposeProvider } from './classes.exposeprovider.webdav.js';
import * as plugins from './plugins.js';
export interface ISmartExposeOptions {
deleteAfterMillis?: number,
privateUrl?: boolean,
}
export class SmartExpose {
// STATIC
public static createWithWebdav(optionsArg: {
webdavCredentials: plugins.smartwebdav.IWebdavClientOptions,
webdavSubPath: string,
exposedBaseUrl: string,
exposeOptions: ISmartExposeOptions,
}) {
const provider = new WebDavExposeProvider({
webdavCredentials: optionsArg.webdavCredentials,
webdavSubPath: optionsArg.webdavSubPath,
});
const smartexposeInstance = new SmartExpose(provider, optionsArg.exposeOptions);
return smartexposeInstance;
}
// INSTANCE
public taskmanager: plugins.taskbuffer.TaskManager;
public options: ISmartExposeOptions;
constructor(provider: ExposeProvider, optionsArg: ISmartExposeOptions) {
this.options = optionsArg;
}
}