botbuilder-dialogs-declarative
Advanced tools
Comparing version
@@ -14,3 +14,5 @@ /** | ||
* Check if a path is a directory | ||
* @param path Path of the diretory | ||
* | ||
* @param path Path of the directory. | ||
* @returns True if the path is a directory; false otherwise. | ||
*/ | ||
@@ -20,3 +22,5 @@ static isDirectory(path: string): boolean; | ||
* Get sub folders in a directory | ||
* @param path Path of root directory | ||
* | ||
* @param path Path of root directory. | ||
* @returns Sub folders in the directory. | ||
*/ | ||
@@ -26,4 +30,6 @@ static getDirectories(path: string): string[]; | ||
* Get files in a directory | ||
* @param path Path of root directory | ||
* @param includeSubFolders Whether include its sub folders | ||
* | ||
* @param path Path of root directory. | ||
* @param includeSubFolders Whether include its sub folders. | ||
* @returns The files in the directory. | ||
*/ | ||
@@ -30,0 +36,0 @@ static getFiles(path: string, includeSubFolders?: boolean): string[]; |
@@ -15,2 +15,3 @@ /** | ||
* Initialize a new instance of the `FileResouce` class. | ||
* | ||
* @param path Path to file. | ||
@@ -21,2 +22,4 @@ */ | ||
* Read text content of a file resource. | ||
* | ||
* @returns Read content text. | ||
*/ | ||
@@ -23,0 +26,0 @@ readText(): string; |
@@ -20,2 +20,3 @@ /** | ||
* Initializes a new instance of the `FolderResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -29,2 +30,4 @@ * @param folder Root folder. | ||
* Gets attached file watcher. | ||
* | ||
* @returns The attached file watcher. | ||
*/ | ||
@@ -46,3 +49,5 @@ readonly watcher: FSWatcher; | ||
* Gets resource by its id. | ||
* | ||
* @param id Resource id. | ||
* @returns The resource by id. | ||
*/ | ||
@@ -52,3 +57,5 @@ getResource(id: string): Resource; | ||
* Gets resources by extension. | ||
* | ||
* @param extension Resource extension. | ||
* @returns Collection of resources. | ||
*/ | ||
@@ -55,0 +62,0 @@ getResources(extension: string): Resource[]; |
@@ -16,2 +16,4 @@ /** | ||
* Resource id. | ||
* | ||
* @returns The resource id. | ||
*/ | ||
@@ -21,2 +23,4 @@ readonly id: string; | ||
* The full path to the resource on disk | ||
* | ||
* @returns The full path to the resource. | ||
*/ | ||
@@ -23,0 +27,0 @@ readonly fullName: string; |
@@ -129,3 +129,3 @@ /** | ||
* @param {Resource} resource Resource id to bind to. | ||
* @returns {T} Type created from resource | ||
* @returns {T} Type created from resource. | ||
*/ | ||
@@ -132,0 +132,0 @@ loadType<T>(resource: Resource): T; |
@@ -30,2 +30,3 @@ /** | ||
* Initialize an instance of `ResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -36,2 +37,3 @@ */ | ||
* Event which is fired if any resource managed by the resource provider detects changes to the underlining resource. | ||
* | ||
* @param callback Callback function to be called when an event fired. | ||
@@ -42,2 +44,4 @@ */ | ||
* Gets the resource explorer. | ||
* | ||
* @returns The resource explorer. | ||
*/ | ||
@@ -47,2 +51,4 @@ readonly resourceExplorer: ResourceExplorer; | ||
* Gets the ID for this resource provider. | ||
* | ||
* @returns The ID for this resource provider. | ||
*/ | ||
@@ -52,2 +58,3 @@ readonly id: string; | ||
* Gets resource by id. | ||
* | ||
* @param id Resource id. | ||
@@ -58,2 +65,3 @@ */ | ||
* Enumerate resources. | ||
* | ||
* @param extension Extension filter. | ||
@@ -60,0 +68,0 @@ */ |
@@ -14,3 +14,5 @@ /** | ||
* Check if a path is a directory | ||
* @param path Path of the diretory | ||
* | ||
* @param path Path of the directory. | ||
* @returns True if the path is a directory; false otherwise. | ||
*/ | ||
@@ -20,3 +22,5 @@ static isDirectory(path: string): boolean; | ||
* Get sub folders in a directory | ||
* @param path Path of root directory | ||
* | ||
* @param path Path of root directory. | ||
* @returns Sub folders in the directory. | ||
*/ | ||
@@ -26,4 +30,6 @@ static getDirectories(path: string): string[]; | ||
* Get files in a directory | ||
* @param path Path of root directory | ||
* @param includeSubFolders Whether include its sub folders | ||
* | ||
* @param path Path of root directory. | ||
* @param includeSubFolders Whether include its sub folders. | ||
* @returns The files in the directory. | ||
*/ | ||
@@ -30,0 +36,0 @@ static getFiles(path: string, includeSubFolders?: boolean): string[]; |
@@ -19,3 +19,5 @@ "use strict"; | ||
* Check if a path is a directory | ||
* @param path Path of the diretory | ||
* | ||
* @param path Path of the directory. | ||
* @returns True if the path is a directory; false otherwise. | ||
*/ | ||
@@ -27,3 +29,5 @@ static isDirectory(path) { | ||
* Get sub folders in a directory | ||
* @param path Path of root directory | ||
* | ||
* @param path Path of root directory. | ||
* @returns Sub folders in the directory. | ||
*/ | ||
@@ -37,4 +41,6 @@ static getDirectories(path) { | ||
* Get files in a directory | ||
* @param path Path of root directory | ||
* @param includeSubFolders Whether include its sub folders | ||
* | ||
* @param path Path of root directory. | ||
* @param includeSubFolders Whether include its sub folders. | ||
* @returns The files in the directory. | ||
*/ | ||
@@ -41,0 +47,0 @@ static getFiles(path, includeSubFolders = true) { |
@@ -15,2 +15,3 @@ /** | ||
* Initialize a new instance of the `FileResouce` class. | ||
* | ||
* @param path Path to file. | ||
@@ -21,2 +22,4 @@ */ | ||
* Read text content of a file resource. | ||
* | ||
* @returns Read content text. | ||
*/ | ||
@@ -23,0 +26,0 @@ readText(): string; |
"use strict"; | ||
/* eslint-disable security/detect-non-literal-fs-filename */ | ||
/** | ||
@@ -19,2 +20,3 @@ * @module botbuilder-dialogs-declarative | ||
* Initialize a new instance of the `FileResouce` class. | ||
* | ||
* @param path Path to file. | ||
@@ -26,6 +28,8 @@ */ | ||
// The id will be the file name, without the path | ||
this._id = this._fullname.replace(/^.*[\\\/]/, ''); | ||
this._id = this._fullname.replace(/^.*[\\/]/, ''); | ||
} | ||
/** | ||
* Read text content of a file resource. | ||
* | ||
* @returns Read content text. | ||
*/ | ||
@@ -32,0 +36,0 @@ readText() { |
@@ -20,2 +20,3 @@ /** | ||
* Initializes a new instance of the `FolderResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -29,2 +30,4 @@ * @param folder Root folder. | ||
* Gets attached file watcher. | ||
* | ||
* @returns The attached file watcher. | ||
*/ | ||
@@ -46,3 +49,5 @@ get watcher(): FSWatcher; | ||
* Gets resource by its id. | ||
* | ||
* @param id Resource id. | ||
* @returns The resource by id. | ||
*/ | ||
@@ -52,3 +57,5 @@ getResource(id: string): Resource; | ||
* Gets resources by extension. | ||
* | ||
* @param extension Resource extension. | ||
* @returns Collection of resources. | ||
*/ | ||
@@ -55,0 +62,0 @@ getResources(extension: string): Resource[]; |
@@ -22,2 +22,3 @@ "use strict"; | ||
* Initializes a new instance of the `FolderResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -50,2 +51,4 @@ * @param folder Root folder. | ||
* Gets attached file watcher. | ||
* | ||
* @returns The attached file watcher. | ||
*/ | ||
@@ -70,3 +73,5 @@ get watcher() { | ||
* Gets resource by its id. | ||
* | ||
* @param id Resource id. | ||
* @returns The resource by id. | ||
*/ | ||
@@ -78,3 +83,5 @@ getResource(id) { | ||
* Gets resources by extension. | ||
* | ||
* @param extension Resource extension. | ||
* @returns Collection of resources. | ||
*/ | ||
@@ -81,0 +88,0 @@ getResources(extension) { |
@@ -16,2 +16,4 @@ /** | ||
* Resource id. | ||
* | ||
* @returns The resource id. | ||
*/ | ||
@@ -21,2 +23,4 @@ get id(): string; | ||
* The full path to the resource on disk | ||
* | ||
* @returns The full path to the resource. | ||
*/ | ||
@@ -23,0 +27,0 @@ get fullName(): string; |
@@ -17,2 +17,4 @@ "use strict"; | ||
* Resource id. | ||
* | ||
* @returns The resource id. | ||
*/ | ||
@@ -24,2 +26,4 @@ get id() { | ||
* The full path to the resource on disk | ||
* | ||
* @returns The full path to the resource. | ||
*/ | ||
@@ -26,0 +30,0 @@ get fullName() { |
@@ -129,3 +129,3 @@ /** | ||
* @param {Resource} resource Resource id to bind to. | ||
* @returns {T} Type created from resource | ||
* @returns {T} Type created from resource. | ||
*/ | ||
@@ -132,0 +132,0 @@ loadType<T>(resource: Resource): T; |
@@ -22,2 +22,5 @@ "use strict"; | ||
class ResourceExplorer { | ||
/** | ||
* @param providersOrOptions The list of [ResourceProvider](xref:botbuilder-dialogs-declarative.ResourceProvider) or configuration options to initialize the current instance. | ||
*/ | ||
constructor(providersOrOptions = []) { | ||
@@ -192,2 +195,6 @@ var _a; | ||
} | ||
/** | ||
* @param resourceOrId The resource or resource id to bind to. | ||
* @returns Type created from resource. | ||
*/ | ||
loadType(resourceOrId) { | ||
@@ -194,0 +201,0 @@ this.registerComponentTypes(); |
@@ -30,2 +30,3 @@ /** | ||
* Initialize an instance of `ResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -36,2 +37,3 @@ */ | ||
* Event which is fired if any resource managed by the resource provider detects changes to the underlining resource. | ||
* | ||
* @param callback Callback function to be called when an event fired. | ||
@@ -42,2 +44,4 @@ */ | ||
* Gets the resource explorer. | ||
* | ||
* @returns The resource explorer. | ||
*/ | ||
@@ -47,2 +51,4 @@ get resourceExplorer(): ResourceExplorer; | ||
* Gets the ID for this resource provider. | ||
* | ||
* @returns The ID for this resource provider. | ||
*/ | ||
@@ -52,2 +58,3 @@ get id(): string; | ||
* Gets resource by id. | ||
* | ||
* @param id Resource id. | ||
@@ -58,2 +65,3 @@ */ | ||
* Enumerate resources. | ||
* | ||
* @param extension Extension filter. | ||
@@ -60,0 +68,0 @@ */ |
@@ -30,2 +30,3 @@ "use strict"; | ||
* Initialize an instance of `ResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -39,2 +40,3 @@ */ | ||
* Event which is fired if any resource managed by the resource provider detects changes to the underlining resource. | ||
* | ||
* @param callback Callback function to be called when an event fired. | ||
@@ -55,2 +57,4 @@ */ | ||
* Gets the resource explorer. | ||
* | ||
* @returns The resource explorer. | ||
*/ | ||
@@ -62,2 +66,4 @@ get resourceExplorer() { | ||
* Gets the ID for this resource provider. | ||
* | ||
* @returns The ID for this resource provider. | ||
*/ | ||
@@ -64,0 +70,0 @@ get id() { |
@@ -5,3 +5,3 @@ { | ||
"description": "Declarative library for the Microsoft BotBuilder dialog system.", | ||
"version": "4.16.0-preview", | ||
"version": "4.17.0-blobs1.preview", | ||
"preview": true, | ||
@@ -32,4 +32,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"botbuilder-dialogs": "4.16.0", | ||
"botbuilder-stdlib": "4.16.0-internal", | ||
"botbuilder-dialogs": "4.17.0-blobs1", | ||
"botbuilder-stdlib": "4.17.0-blobs1.internal", | ||
"chokidar": "^3.4.0", | ||
@@ -39,5 +39,5 @@ "zod": "~1.11.17" | ||
"devDependencies": { | ||
"adaptive-expressions": "4.16.0", | ||
"botbuilder-core": "4.16.0", | ||
"botbuilder-dialogs-adaptive-runtime-core": "4.16.0-preview", | ||
"adaptive-expressions": "4.17.0-blobs1", | ||
"botbuilder-core": "4.17.0-blobs1", | ||
"botbuilder-dialogs-adaptive-runtime-core": "4.17.0-blobs1.preview", | ||
"jsonschema": "^1.4.0" | ||
@@ -44,0 +44,0 @@ }, |
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
public constructor(private readonly _resourceExplorer: ResourceExplorer) {} | ||
constructor(private readonly _resourceExplorer: ResourceExplorer) {} | ||
@@ -33,3 +33,3 @@ /** | ||
*/ | ||
public load(config: Record<string, unknown>, type: Newable<Configurable>): Configurable { | ||
load(config: Record<string, unknown>, type: Newable<Configurable>): Configurable { | ||
return Object.entries(config).reduce((instance, [key, value]) => { | ||
@@ -36,0 +36,0 @@ let converter = instance.getConverter(key); |
@@ -18,5 +18,7 @@ /** | ||
* Check if a path is a directory | ||
* @param path Path of the diretory | ||
* | ||
* @param path Path of the directory. | ||
* @returns True if the path is a directory; false otherwise. | ||
*/ | ||
public static isDirectory(path: string): boolean { | ||
static isDirectory(path: string): boolean { | ||
return lstatSync(path).isDirectory(); | ||
@@ -27,5 +29,7 @@ } | ||
* Get sub folders in a directory | ||
* @param path Path of root directory | ||
* | ||
* @param path Path of root directory. | ||
* @returns Sub folders in the directory. | ||
*/ | ||
public static getDirectories(path: string): string[] { | ||
static getDirectories(path: string): string[] { | ||
return readdirSync(path) | ||
@@ -38,6 +42,8 @@ .map((name: string): string => join(path, name)) | ||
* Get files in a directory | ||
* @param path Path of root directory | ||
* @param includeSubFolders Whether include its sub folders | ||
* | ||
* @param path Path of root directory. | ||
* @param includeSubFolders Whether include its sub folders. | ||
* @returns The files in the directory. | ||
*/ | ||
public static getFiles(path: string, includeSubFolders = true): string[] { | ||
static getFiles(path: string, includeSubFolders = true): string[] { | ||
return readdirSync(path) | ||
@@ -44,0 +50,0 @@ .map((name: string): string => join(path, name)) |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable security/detect-non-literal-fs-filename */ | ||
/** | ||
@@ -18,9 +19,10 @@ * @module botbuilder-dialogs-declarative | ||
* Initialize a new instance of the `FileResouce` class. | ||
* | ||
* @param path Path to file. | ||
*/ | ||
public constructor(path: string) { | ||
constructor(path: string) { | ||
super(); | ||
this._fullname = path; | ||
// The id will be the file name, without the path | ||
this._id = this._fullname.replace(/^.*[\\\/]/, ''); | ||
this._id = this._fullname.replace(/^.*[\\/]/, ''); | ||
} | ||
@@ -30,4 +32,6 @@ | ||
* Read text content of a file resource. | ||
* | ||
* @returns Read content text. | ||
*/ | ||
public readText(): string { | ||
readText(): string { | ||
const filePath = this._fullname; | ||
@@ -34,0 +38,0 @@ const text = fs.readFileSync(filePath, 'utf-8'); |
@@ -26,2 +26,3 @@ /** | ||
* Initializes a new instance of the `FolderResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
@@ -32,8 +33,3 @@ * @param folder Root folder. | ||
*/ | ||
public constructor( | ||
resourceExplorer: ResourceExplorer, | ||
folder: string, | ||
includeSubFolders = true, | ||
monitorChanges = true | ||
) { | ||
constructor(resourceExplorer: ResourceExplorer, folder: string, includeSubFolders = true, monitorChanges = true) { | ||
super(resourceExplorer); | ||
@@ -58,4 +54,6 @@ | ||
* Gets attached file watcher. | ||
* | ||
* @returns The attached file watcher. | ||
*/ | ||
public get watcher(): FSWatcher { | ||
get watcher(): FSWatcher { | ||
return this._watcher; | ||
@@ -67,3 +65,3 @@ } | ||
*/ | ||
public directory: string; | ||
directory: string; | ||
@@ -73,3 +71,3 @@ /** | ||
*/ | ||
public includeSubFolders = true; | ||
includeSubFolders = true; | ||
@@ -79,3 +77,3 @@ /** | ||
*/ | ||
public refresh(): void { | ||
refresh(): void { | ||
this._resources.clear(); | ||
@@ -95,5 +93,7 @@ const files: string[] = PathUtil.getFiles(this.directory, this.includeSubFolders); | ||
* Gets resource by its id. | ||
* | ||
* @param id Resource id. | ||
* @returns The resource by id. | ||
*/ | ||
public getResource(id: string): Resource { | ||
getResource(id: string): Resource { | ||
return this._resources.has(id) ? this._resources.get(id) : undefined; | ||
@@ -104,5 +104,7 @@ } | ||
* Gets resources by extension. | ||
* | ||
* @param extension Resource extension. | ||
* @returns Collection of resources. | ||
*/ | ||
public getResources(extension: string): Resource[] { | ||
getResources(extension: string): Resource[] { | ||
extension = extension.startsWith('.') ? extension.toLowerCase() : `.${extension.toLowerCase()}`; | ||
@@ -109,0 +111,0 @@ |
@@ -19,4 +19,6 @@ /** | ||
* Resource id. | ||
* | ||
* @returns The resource id. | ||
*/ | ||
public get id(): string { | ||
get id(): string { | ||
return this._id; | ||
@@ -27,4 +29,6 @@ } | ||
* The full path to the resource on disk | ||
* | ||
* @returns The full path to the resource. | ||
*/ | ||
public get fullName(): string { | ||
get fullName(): string { | ||
return this._fullname; | ||
@@ -36,3 +40,3 @@ } | ||
*/ | ||
public abstract readText(): string; | ||
abstract readText(): string; | ||
} |
@@ -39,3 +39,3 @@ /** | ||
*/ | ||
public constructor(providers: ResourceProvider[]); | ||
constructor(providers: ResourceProvider[]); | ||
/** | ||
@@ -46,4 +46,7 @@ * Initializes a new instance of the [ResourceExplorer](botbuilder-dialogs.declarative.ResourceExplorer) class. | ||
*/ | ||
public constructor(options?: ResourceExplorerOptions); | ||
public constructor(providersOrOptions: ResourceProvider[] | ResourceExplorerOptions = []) { | ||
constructor(options?: ResourceExplorerOptions); | ||
/** | ||
* @param providersOrOptions The list of [ResourceProvider](xref:botbuilder-dialogs-declarative.ResourceProvider) or configuration options to initialize the current instance. | ||
*/ | ||
constructor(providersOrOptions: ResourceProvider[] | ResourceExplorerOptions = []) { | ||
if (Array.isArray(providersOrOptions)) { | ||
@@ -64,3 +67,3 @@ const providers: ResourceProvider[] = providersOrOptions; | ||
*/ | ||
public readonly resourceProviders: ResourceProvider[]; | ||
readonly resourceProviders: ResourceProvider[]; | ||
@@ -70,3 +73,3 @@ /** | ||
*/ | ||
public readonly resourceTypes: Set<string> = new Set(['dialog', 'lu', 'lg', 'qna', 'schema', 'json']); | ||
readonly resourceTypes: Set<string> = new Set(['dialog', 'lu', 'lg', 'qna', 'schema', 'json']); | ||
@@ -76,3 +79,3 @@ /** | ||
*/ | ||
public set changed(callback: (event: ResourceChangeEvent, resources: Resource[]) => void) { | ||
set changed(callback: (event: ResourceChangeEvent, resources: Resource[]) => void) { | ||
this._eventEmitter.on(ResourceChangeEvent.added, (resources: Resource[]): void => { | ||
@@ -94,3 +97,3 @@ callback(ResourceChangeEvent.added, resources); | ||
*/ | ||
public addResourceType(type: string): void { | ||
addResourceType(type: string): void { | ||
type = type.toLowerCase().replace(/^\./, ''); | ||
@@ -106,3 +109,3 @@ if (!this.resourceTypes.has(type)) { | ||
*/ | ||
public refresh(): void { | ||
refresh(): void { | ||
this.resourceProviders.forEach((resourceProvider) => resourceProvider.refresh()); | ||
@@ -117,3 +120,3 @@ } | ||
*/ | ||
public addResourceProvider(resourceProvider: ResourceProvider): ResourceExplorer { | ||
addResourceProvider(resourceProvider: ResourceProvider): ResourceExplorer { | ||
if (this.resourceProviders.some((r): boolean => r.id === resourceProvider.id)) { | ||
@@ -137,3 +140,3 @@ throw Error(`${resourceProvider.id} has already been added as a resource`); | ||
*/ | ||
public addFolder(folder: string, includeSubFolders = true, monitorChanges = true): ResourceExplorer { | ||
addFolder(folder: string, includeSubFolders = true, monitorChanges = true): ResourceExplorer { | ||
this.addResourceProvider(new FolderResourceProvider(this, folder, includeSubFolders, monitorChanges)); | ||
@@ -152,3 +155,3 @@ | ||
*/ | ||
public addFolders(folder: string, ignoreFolders?: string[], monitorChanges = true): ResourceExplorer { | ||
addFolders(folder: string, ignoreFolders?: string[], monitorChanges = true): ResourceExplorer { | ||
if (ignoreFolders) { | ||
@@ -178,3 +181,3 @@ folder = normalize(folder); | ||
*/ | ||
public getResources(fileExtension: string): Resource[] { | ||
getResources(fileExtension: string): Resource[] { | ||
const resources: Resource[] = []; | ||
@@ -196,3 +199,3 @@ for (const rp of this.resourceProviders) { | ||
*/ | ||
public getResource(id: string): Resource { | ||
getResource(id: string): Resource { | ||
for (const rp of this.resourceProviders) { | ||
@@ -217,3 +220,3 @@ const resource: Resource = rp.getResource(id); | ||
*/ | ||
public registerType<T>( | ||
registerType<T>( | ||
kind: string, | ||
@@ -237,3 +240,3 @@ type: Newable<T>, | ||
*/ | ||
public buildType<T, C>(kind: string, config: C): T { | ||
buildType<T, C>(kind: string, config: C): T { | ||
this.registerComponentTypes(); | ||
@@ -256,3 +259,3 @@ | ||
*/ | ||
public loadType<T>(resourceId: string): T; | ||
loadType<T>(resourceId: string): T; | ||
/** | ||
@@ -263,6 +266,10 @@ * Load type from resource | ||
* @param {Resource} resource Resource id to bind to. | ||
* @returns {T} Type created from resource | ||
* @returns {T} Type created from resource. | ||
*/ | ||
public loadType<T>(resource: Resource): T; | ||
public loadType<T>(resourceOrId: Resource | string): T { | ||
loadType<T>(resource: Resource): T; | ||
/** | ||
* @param resourceOrId The resource or resource id to bind to. | ||
* @returns Type created from resource. | ||
*/ | ||
loadType<T>(resourceOrId: Resource | string): T { | ||
this.registerComponentTypes(); | ||
@@ -269,0 +276,0 @@ |
@@ -35,5 +35,6 @@ /** | ||
* Initialize an instance of `ResourceProvider` class. | ||
* | ||
* @param resourceExplorer Resource explorer. | ||
*/ | ||
public constructor(resourceExplorer: ResourceExplorer) { | ||
constructor(resourceExplorer: ResourceExplorer) { | ||
this._resourceExplorer = resourceExplorer; | ||
@@ -44,5 +45,6 @@ } | ||
* Event which is fired if any resource managed by the resource provider detects changes to the underlining resource. | ||
* | ||
* @param callback Callback function to be called when an event fired. | ||
*/ | ||
public set changed(callback: (event: ResourceChangeEvent, resources: Resource[]) => void) { | ||
set changed(callback: (event: ResourceChangeEvent, resources: Resource[]) => void) { | ||
this._eventEmitter.on(ResourceChangeEvent.added, (resources: Resource[]): void => { | ||
@@ -61,4 +63,6 @@ callback(ResourceChangeEvent.added, resources); | ||
* Gets the resource explorer. | ||
* | ||
* @returns The resource explorer. | ||
*/ | ||
public get resourceExplorer(): ResourceExplorer { | ||
get resourceExplorer(): ResourceExplorer { | ||
return this._resourceExplorer; | ||
@@ -69,4 +73,6 @@ } | ||
* Gets the ID for this resource provider. | ||
* | ||
* @returns The ID for this resource provider. | ||
*/ | ||
public get id(): string { | ||
get id(): string { | ||
return this._id; | ||
@@ -77,11 +83,13 @@ } | ||
* Gets resource by id. | ||
* | ||
* @param id Resource id. | ||
*/ | ||
public abstract getResource(id: string): Resource; | ||
abstract getResource(id: string): Resource; | ||
/** | ||
* Enumerate resources. | ||
* | ||
* @param extension Extension filter. | ||
*/ | ||
public abstract getResources(extension: string): Resource[]; | ||
abstract getResources(extension: string): Resource[]; | ||
@@ -91,3 +99,3 @@ /** | ||
*/ | ||
public abstract refresh(): void; | ||
abstract refresh(): void; | ||
@@ -94,0 +102,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
120755
2.59%2648
4.79%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed