import { PatternLibrary } from './pattern-library' ; import * as Types from '@meetalva/types' ; export interface PatternLibraryFileInit { id : string ; relativePath : string ; content : Buffer ; } export interface ProjectFileContext { patternLibrary : PatternLibrary ; } export class PatternLibraryFile { private readonly content : Buffer ; private readonly id : string ; private readonly relativePath : string ; public constructor ( init , context ) { this . id = init . id ; this . relativePath = init . relativePath ; this . content = init . content ; } public from ( serialized , context ) { return new PatternLibraryFile ( serialized , context ) ; } public getId ( ) { return this . id ; } public getContent ( ) { return this . content ; } public getRelativePath ( ) { return this . relativePath ; } public toJSON ( ) { return { content : this . content , id : this . id , relativePath : this . relativePath } ; } }