Hans Larsen ca31640505 refactor(@angular-devkit/core): change the job context scheduler to generic
That scheduler is really an any scheduler and would need to be typed
appropriately. There could be multiple schedulers that this job is
part of and it is impossible to ensure the scheduler is a more specific
type than unknown.

Note: This was wrongly typed before.

Context: JsonValue is the JSON equivalent of the unknown TS type.
2019-02-07 15:57: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