hunk.code_window:   get() {
       if (!this.defined && this._forward) {
         return this._forward.get();
       }
       if (!this.defined && this._default !== undefined) {
         return this._default;
       }
  
hunk.labels: keep keep keep keep keep replace replace keep
hunk.after_edit:     if (!this.defined) {
         return this._default !== undefined ? this._default : undefined;
  
hunk.file_path: packages/@ngtools/json-schema/src/schema-tree.ts
hunk.type: replace
file: import {JsonSchemaErrorBase} from './error';
  import {Serializer, WriterFn} from './serializer';
  import {JsonSerializer} from './serializers/json';
  import {DTsSerializer} from './serializers/dts';
  
  
  export class UnknownMimetype extends JsonSchemaErrorBase {}
  
  
  export function createSerializerFromMimetype(mimetype: string,
                                               writer: WriterFn,
                                               ...opts: any[]): Serializer {
    let Klass: { new (writer: WriterFn, ...args: any[]): Serializer } = null;
    switch (mimetype) {
      case 'application/json': Klass = JsonSerializer; break;
      case 'text/json': Klass = JsonSerializer; break;
      case 'text/x.typescript': Klass = DTsSerializer; break;
      case 'text/x.dts': Klass = DTsSerializer; break;
  
      default: throw new UnknownMimetype();
    }
  
    return new Klass(writer, ...opts);
  
  }
  
  
  declare module './serializer' {
    namespace Serializer {
      export let fromMimetype: typeof createSerializerFromMimetype;
    }
  }
  
  Serializer.fromMimetype = createSerializerFromMimetype;
  