import { Package } from 'dgeni' ; import nunjucks from 'dgeni-packages/nunjucks' ; import typescript from 'dgeni-packages/typescript' ; import * as path from 'path' ; import { textProcessor } from './processors' ; const docFiles = [ 'neo-one-client-core/src/types.ts' , 'neo-one-client-core/src/Client.ts' , 'neo-one-client-core/src/DeveloperClient.ts' , 'neo-one-client-core/src/Hash256.ts' , 'neo-one-client-core/src/user/LocalUserAccountProvider.ts' , 'neo-one-client-core/src/user/LocalKeyStore.ts' , 'neo-one-client-core/src/user/LocalMemoryStore.ts' , 'neo-one-client-core/src/user/LocalStringStore.ts' , 'neo-one-client-core/src/provider/JSONRPCProvider.ts' , 'neo-one-client-core/src/provider/NEOONEDataProvider.ts' , 'neo-one-client-core/src/provider/NEOONEOneDataProvider.ts' , 'neo-one-client-core/src/provider/NEOONEProvider.ts' , 'neo-one-client-common/src/types.ts' , 'neo-one-client-common/src/helpers.ts' , 'neo-one-smart-contract/src/index.d.ts' , ] ; ( typescript as any ) . config ( function ( parseTagsProcessor ) { const tagDefs = parseTagsProcessor . tagDefinitions ; tagDefs . push ( { name : 'example' , multi : true } ) ; tagDefs . push ( { name : 'param' , multi : true } ) ; tagDefs . push ( { name : 'internal' } ) ; } ) . config ( function ( computeIdsProcessor , computePathsProcessor ) { computeIdsProcessor . idTemplates . push ( { docTypes : [ 'get-accessor-info' ] , idTemplate : '${containerDoc.id}.${name}' , getAliases ( doc ) { return doc . containerDoc . aliases . map ( ( alias ) => `${ alias }.${ doc . name }` ) ; } } ) ; computePathsProcessor . pathTemplates . push ( { docTypes : [ 'get-accessor-info' ] , pathTemplate : '${containerDoc.path}#${name}' , getOutputPath ( ) { } } ) ; computePathsProcessor . pathTemplates . push ( { docTypes : [ 'const' , 'interface' , 'class' , 'type-alias' , 'decorator' , 'function' , 'enum' ] , outputPathTemplate : 'partials/modules/${path}/index.html' , pathTemplate : '${moduleDoc.path}/${docType}/${name}' } ) ; } ) ; export const dgeniSetup = new Package ( 'neo-one-docs' , [ typescript , nunjucks , ] ) . processor ( textProcessor ) . config ( function ( readFilesProcessor , readTypeScriptModules , templateFinder , writeFilesProcessor ) { readTypeScriptModules . basePath = path . resolve ( __dirname , '../../..' ) ; readFilesProcessor . basePath = '' ; readTypeScriptModules . sourceFiles = docFiles ; readFilesProcessor . sourceFiles = [ ] ; templateFinder . templateFolders . unshift ( path . resolve ( __dirname , 'templates' ) ) ; templateFinder . templatePatterns . unshift ( 'template.txt' ) ; writeFilesProcessor . outputFolder = path . resolve ( __dirname , '../../../neo-one-website/src/utils/build' ) ; } ) ;