This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-h5/src/DoricRegistry.ts
pengfei.zhou d0f1320656 move dir
2019-12-21 23:37:21 +08:00

51 lines
1.6 KiB
TypeScript

import { DoricPluginClass } from "./DoricPlugin"
import { ShaderPlugin } from "./plugins/ShaderPlugin"
import { DoricViewNodeClass } from "./shader/DoricViewNode"
import { DoricStackNode } from "./shader/DoricStackNode"
import { DoricVLayoutNode } from './shader/DoricVLayoutNode'
import { DoricHLayoutNode } from './shader/DoricHLayoutNode'
import { DoricTextNode } from "./shader/DoricTextNode"
import { DoricImageNode } from "./shader/DoricImageNode"
import { DoricScrollerNode } from "./shader/DoricScrollerNode"
import { ModalPlugin } from './plugins/ModalPlugin'
const bundles: Map<string, string> = new Map
const plugins: Map<string, DoricPluginClass> = new Map
const nodes: Map<string, DoricViewNodeClass> = new Map
export function acquireJSBundle(name: string) {
return bundles.get(name)
}
export function registerJSBundle(name: string, bundle: string) {
bundles.set(name, bundle)
}
export function registerPlugin(name: string, plugin: DoricPluginClass) {
plugins.set(name, plugin)
}
export function acquirePlugin(name: string) {
return plugins.get(name)
}
export function registerViewNode(name: string, node: DoricViewNodeClass) {
nodes.set(name, node)
}
export function acquireViewNode(name: string) {
return nodes.get(name)
}
registerPlugin('shader', ShaderPlugin)
registerPlugin('modal', ModalPlugin)
registerViewNode('Stack', DoricStackNode)
registerViewNode('VLayout', DoricVLayoutNode)
registerViewNode('HLayout', DoricHLayoutNode)
registerViewNode('Text', DoricTextNode)
registerViewNode('Image', DoricImageNode)
registerViewNode('Scroller', DoricScrollerNode)