0.1.5 • Published 6 months ago

@types/object-refs v0.1.5

Weekly downloads
373
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/object-refs

Summary

This package contains type definitions for object-refs (https://github.com/bpmn-io/object-refs).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/object-refs.

index.d.ts

// Type definitions for object-refs 0.1.1
// Project: https://github.com/bpmn-io/object-refs
// Definitions by: Jan Steinbruecker <https://github.com/3fd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = Refs;

declare class Refs {

    /**
     * Creates a new references object defining two inversly related
     * attribute descriptors a and b.
     * @param {Refs.AttributeDescriptor} a property descriptor
     * @param {Refs.AttributeDescriptor} b property descriptor
     **/
    constructor(a: Refs.AttributeDescriptor, b: Refs.AttributeDescriptor);

    /**
     * Binds one side of a bi-directional reference to a target object.
     * @param {*} target
     * @param {string|Refs.AttributeDescriptor} property
     */
    bind(target: any, property: string|Refs.AttributeDescriptor): void;

    ensureBound(target: any, property: string|Refs.AttributeDescriptor): void;

    ensureRefsCollection(target: any, property: Refs.AttributeDescriptor): any;

    set(target: any, property: string|Refs.AttributeDescriptor, value: any): void;

    unset(target: any, property: string|Refs.AttributeDescriptor, value: any): void;

}

declare namespace Refs {

    interface AttributeDescriptor {
        name: string;
        collection?: boolean | undefined;
        enumerable?: boolean | undefined;
    }

    namespace Collection {

        /** Extends a collection with Refs aware methods */
        function extend(collection: any[], refs: Refs, property: string|AttributeDescriptor, target: any): any;

        function isExtended(collection: any[]): boolean;

    }

}

Additional Details

  • Last updated: Thu, 08 Jul 2021 18:51:44 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Jan Steinbruecker.

0.1.4

7 months ago

0.1.3

8 months ago

0.1.5

6 months ago

0.1.2

3 years ago

0.1.1

8 years ago