import { Equatable, Serializable } from "./../utilities"; import { Actor } from "../entities"; import { Scopable } from "./../scopable"; /** * Resource * * A resource. */ export declare abstract class Resource implements Scopable, Equatable, Serializable { readonly name: string; readonly scope: string; /** * Creates a Resource. * @param name The name of the resource. * @param scope the scope of the resource. Defaults to the global scope. */ constructor(name: string, scope?: string); /** * Collection * * Creates a resource collection instance. * @param name the name of the resource. This name should be plural. * @param scope the scope of the resource instance. Defaults to the global scope. * @returns an instance of a resource collection. */ static Collection(name: string, scope?: string): ResourceCollection; /** * Instance() * * Creates a resource instance. * @param name the name of the resource. This should be plural, as it refers to the resource collection. * @param id a unique identifier used to identify the resource instance. * @param owner a unique identifier for the owner of the resource. * @param scope the scope of the resource. Defaults to Global scope. * @returns a ResourceInstance instance. */ static Instance(name: string, id: string, owner: string, scope?: string): ResourceInstance; /** * InstanceOf() * * Creates a Resource Instance from the provided resource collection. * @param collection the collection to derrive from. * @param id the id of the instance. * @param owner the owner of the instance. * @returns the created instance. */ static InstanceOf(collection: ResourceCollection, id: string, owner: Actor): ResourceInstance; equals(suspect: any): boolean; serialize(): string; } /** * ResourceCollection * * A Resource Collection. */ export declare class ResourceCollection extends Resource { constructor(name: string, scope?: string); equals(suspect: any): boolean; } /** * ResourceInstance * * An instance of a Resource. */ export declare class ResourceInstance extends Resource { readonly id: string; readonly owner: string; constructor(name: string, id: string, owner: string, scope?: string); equals(suspect: any): boolean; serialize(): string; toString(): string; }