/*! * Copyright 2020 Ron Buckton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { GraphSchema } from "./graphSchema"; import type { GraphSchemaNameLike } from "./graphSchemaNameLike"; import { BaseCollection } from "./baseCollection"; import { EventSubscription } from "./events"; /** * A collection of child schemas in a schema. */ export declare class GraphSchemaCollection extends BaseCollection { private _schema; private _schemas; private _events?; private constructor(); /** * Gets the schema that owns the collection. */ get schema(): GraphSchema; /** * Gets the number of schemas in the collection. */ get size(): number; /** * Creates a subscription for a set of named events. */ subscribe(events: GraphSchemaCollectionEvents): EventSubscription; /** * Determines whether the collection contains the specified schema. */ has(schema: GraphSchema | GraphSchemaNameLike): boolean; /** * Gets the property with the specified name. */ get(name: GraphSchemaNameLike): GraphSchema | undefined; /** * Adds a schema to the collection. */ add(schema: GraphSchema): this; /** * Gets the schema names in the collection. */ keys(): IterableIterator; /** * Gets the schemas in the collection. */ values(): IterableIterator; /** * Gets the schemas in the collection. */ entries(): IterableIterator<[GraphSchemaNameLike, GraphSchema]>; /** * Gets the schemas in the collection. */ [Symbol.iterator](): IterableIterator; private _raiseOnAdded; } export interface GraphSchemaCollectionEvents { /** * An event raised when a schema is added to the collection. */ onAdded?: (schema: GraphSchema) => void; }