todo todo export interface DocMeta { title ? : string ; author ? : string ; url ? : string ; date ? : string ; tags_defined ? : string | string [ ] ; tags ? : string | string [ ] ; } export interface IDoc { getMeta ( ) : DocMeta ; } export interface IDocParser { parse ( serialized ) : IDoc | null ; } interface IDocClass < T extends IDoc > { new ( ... args ) : T ; parse ( serialized ) : T | null ; } export class DocParser < T extends IDoc > implements IDocParser { constructor ( private _classToCreate ) { } parse ( serialized ) { return this . _classToCreate . parse ( serialized ) ; } } export interface IAstParser { parseAST ( serialized ) : IDoc | null ; } interface IAstClass < T extends IDoc > { new ( ... args ) : T ; parseAST ( serialized ) : T | null ; } export class AstParser < T extends IDoc > implements IDocParser { constructor ( private _classToCreate ) { } parse ( serialized ) { return this . _classToCreate . parseAST ( serialized ) ; } }