Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/decorator-registries/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ yarn-error.log
junit.xml

/src/mirador-viewer/config.local.js

## ignore the auto-generated decorator registries
decorator-registries/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"serve": "ts-node --project ./tsconfig.ts-node.json scripts/serve.ts",
"serve:ssr": "node dist/server/main",
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
"generate:decorator:registries": "ts-node --project ./tsconfig.ts-node.json scripts/generate-decorator-registries.ts",
"build": "ng build --configuration development",
"build:stats": "ng build --stats-json",
"build:prod": "cross-env NODE_ENV=production npm run build:ssr",
Expand Down
16 changes: 16 additions & 0 deletions scripts/config/decorator-config.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { DecoratorParam } from './decorator-param.interface';

/**
* The configuration for a dynamic component decorator. This is used to generate the registry files.
*/
export interface DecoratorConfig {
/**
* Name of the decorator
*/
name: string;

/**
* List of DecoratorParams
*/
params: DecoratorParam[];
}
26 changes: 26 additions & 0 deletions scripts/config/decorator-param.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* The configuration for a decorator parameter.
*/
export interface DecoratorParam {
/**
* The name of the parameter
*/
name: string;

/**
* The default value of the decorator param
*
* (Optional)
*/
default?: string;

/**
* The property of the provided parameter value that should be used instead of the value itself.
*
* For example, if the parameter value is {@link ResourceType} 'BITSTREAM', you'll want to use 'BITSTREAM.value'
* instead of the whole {@link ResourceType} object. In this case the {@link DecoratorParam#property} is `value`.
*
* (Optional)
*/
property?: string;
}
Loading