import Controllable from './abstract/Controllable' ; import Router from './control/Router' ; import http from './protocol/http' ; import sse from './protocol/sse' ; import ws from './protocol/ws' ; import { requireAll , makeChain } from './utility' ; param directory param accept param join returns export function synapse ( directory , accept = [ ] , join = [ ] ) { const router = new Router ( ) ; requireAll ( directory ) . forEach ( ( module ) => { if ( module ) { const Type = module . default || module ; if ( Type . prototype instanceof Controllable ) { router . declare ( 'use' , '/' , Type . router ) ; } } } ) ; const callback = makeChain ( ) ; return { http : http ( router , callback ) , sse : sse ( router , callback ) , ws : ws ( router , callback , accept , join ) , use : callback . add , } ; } export { default as State } from './State' ; export { default as Resource } from './Resource' ; export { default as Collection } from './Collection' ; export { default as Field } from './Field' ; export { default as Schema } from './Schema' ; export * as abstract from './abstract' ; export * as control from './control' ; export * as decorators from './abstract/@' ; export * as fields from './fields' ; export * as protocol from './protocol' ; export * as utility from './utility' ;