Charles Lyding a1aa8d56c4 feat(@angular-devkit/core): add workspace reader/writer core API
NOTE: No changes have yet been made to the public API of the package.
This introduces the core and eventual public API for the stable workspace API.  This is not intended to be feature complete but rather represents the initial base infrastucture necessary for pending future feature additions.
2019-03-06 11:34:05 -08:00
..
2019-02-26 08:33:48 -08:00

Core

Shared utilities for Angular DevKit.

Exception

Json

Schema

SchemaValidatorResult

export interface SchemaValidatorResult {
  success: boolean;
  errors?: string[];
}

SchemaValidator

export interface SchemaValidator {
  (data: any): Observable<SchemaValidatorResult>;
}

SchemaFormatter

export interface SchemaFormatter {
  readonly async: boolean;
  validate(data: any): boolean | Observable<boolean>;
}

SchemaRegistry

export interface SchemaRegistry {
  compile(schema: Object): Observable<SchemaValidator>;
  addFormat(name: string, formatter: SchemaFormatter): void;
}

CoreSchemaRegistry

SchemaRegistry implementation using https://github.com/epoberezkin/ajv. Constructor accepts object containing SchemaFormatter that will be added automatically.

export class CoreSchemaRegistry implements SchemaRegistry {
  constructor(formats: { [name: string]: SchemaFormatter} = {}) {}
}

Logger

Utils

Virtual FS