Edit

Share via


ConfigurationResourceExporer class

Class which gives access to content resources by specifying configuration and declarativeTypes.

Extends

ResourceExplorer

Constructors

ConfigurationResourceExporer(Configuration, ComponentDeclarativeTypes[])

Inherited Properties

changed
resourceProviders

Gets resource providers.

resourceTypes

Gets resource type id extensions managed by resource explorer.

Inherited Methods

addFolder(string, boolean, boolean)

Add a folder resource.

addFolders(string, string[], boolean)

Add folder resources.

addResourceProvider(ResourceProvider)

Add a resource provider to the resources managed by resource explorer.

addResourceType(string)

Add a resource type to resource type set.

buildType<T, C>(string, C)

Build type for given $kind from configuration.

getResource(string)

Gets resource by id.

getResources(string)

Get resources of a given type extension.

loadType<T>(Resource)

Load type from resource

loadType<T>(string)

Load type from resource

refresh()

Reload any cached data.

registerType<T>(string, Newable<T>, CustomDeserializer<T, Record<string, unknown>>)

Register a declarative type with the resource loader system.

Constructor Details

ConfigurationResourceExporer(Configuration, ComponentDeclarativeTypes[])

new ConfigurationResourceExporer(configuration: Configuration, declarativeTypes: ComponentDeclarativeTypes[])

Parameters

configuration
Configuration

Additional configuration methods.

declarativeTypes

ComponentDeclarativeTypes[]

Registered declarative types.

Inherited Property Details

changed

changed: (event: ResourceChangeEvent, resources: Resource[]) => void

Property Value

(event: ResourceChangeEvent, resources: Resource[]) => void

Inherited From ResourceExplorer.changed

resourceProviders

Gets resource providers.

resourceProviders: ResourceProvider[]

Property Value

ResourceProvider[]

Inherited From ResourceExplorer.resourceProviders

resourceTypes

Gets resource type id extensions managed by resource explorer.

resourceTypes: Set<string>

Property Value

Set<string>

Inherited From ResourceExplorer.resourceTypes

Inherited Method Details

addFolder(string, boolean, boolean)

Add a folder resource.

function addFolder(folder: string, includeSubFolders?: boolean, monitorChanges?: boolean): ResourceExplorer

Parameters

folder

string

Folder to be included as a resource.

includeSubFolders

boolean

Whether to include subfolders.

monitorChanges

boolean

Whether to track changes.

Returns

ResourceExplorer

Resource explorer so that you can fluently call multiple methods on the resource explorer.

Inherited From ResourceExplorer.addFolder

addFolders(string, string[], boolean)

Add folder resources.

function addFolders(folder: string, ignoreFolders?: string[], monitorChanges?: boolean): ResourceExplorer

Parameters

folder

string

Collection of folders to be included as resources.

ignoreFolders

string[]

Imediate subfolders to ignore.

monitorChanges

boolean

Whether to track changes.

Returns

ResourceExplorer

Resource explorer so that you can fluently call multiple methods on the resource explorer.

Inherited From ResourceExplorer.addFolders

addResourceProvider(ResourceProvider)

Add a resource provider to the resources managed by resource explorer.

function addResourceProvider(resourceProvider: ResourceProvider): ResourceExplorer

Parameters

resourceProvider

ResourceProvider

Resource provider to be added.

Returns

ResourceExplorer

Resource explorer so that you can fluently call multiple methods on the resource explorer.

Inherited From ResourceExplorer.addResourceProvider

addResourceType(string)

Add a resource type to resource type set.

function addResourceType(type: string)

Parameters

type

string

Resource type.

Inherited From ResourceExplorer.addResourceType

buildType<T, C>(string, C)

Build type for given $kind from configuration.

function buildType<T, C>(kind: string, config: C): T

Parameters

kind

string

$kind.

config

C

Source configuration object.

Returns

T

Instantiated object.

Inherited From ResourceExplorer.buildType

getResource(string)

Gets resource by id.

function getResource(id: string): Resource

Parameters

id

string

Resource id.

Returns

Resource

The resource, or undefined if not found.

Inherited From ResourceExplorer.getResource

getResources(string)

Get resources of a given type extension.

function getResources(fileExtension: string): Resource[]

Parameters

fileExtension

string

File extension filter.

Returns

Resource[]

The resources.

Inherited From ResourceExplorer.getResources

loadType<T>(Resource)

Load type from resource

function loadType<T>(resource: Resource): T

Parameters

resource

Resource

Resource id to bind to.

Returns

T

Type created from resource.

Inherited From ResourceExplorer.loadType

loadType<T>(string)

Load type from resource

function loadType<T>(resourceId: string): T

Parameters

resourceId

string

Resource id to bind to.

Returns

T

Type created from resource

Inherited From ResourceExplorer.loadType

refresh()

Reload any cached data.

function refresh()

Inherited From ResourceExplorer.refresh

registerType<T>(string, Newable<T>, CustomDeserializer<T, Record<string, unknown>>)

Register a declarative type with the resource loader system.

function registerType<T>(kind: string, type: Newable<T>, loader?: CustomDeserializer<T, Record<string, unknown>>): ResourceExplorer

Parameters

kind

string

The $kind name to map to this type.

type

Newable<T>

Type of object to create.

loader

CustomDeserializer<T, Record<string, unknown>>

Optional custom deserializer.

Returns

ResourceExplorer

Resource explorer for fluent style multiple calls.

Inherited From ResourceExplorer.registerType