How to use the deprecated-decorator.deprecated function in deprecated-decorator

To help you get started, we’ve selected a few deprecated-decorator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stonelasley / ionic-mocks / src / angular / events.ts View on Github external
import { BaseMock } from './../base.mock';
import { deprecated } from 'deprecated-decorator';

const METHODS = ['subscribe', 'publish', 'unsubscribe'];

export class EventsMock extends BaseMock {
    constructor() {
        super('Events', METHODS);
    }

    @deprecated('new EventsMock()')
    public static instance(): any {
        return new EventsMock();
    }
}
github stonelasley / ionic-mocks / src / native / vibration.ts View on Github external
import { deprecated } from 'deprecated-decorator';
import { BaseMock } from '../base.mock';

const METHODS = ['vibrate',
];

export class VibrationMock extends BaseMock {
    constructor() {
        super('Vibration', METHODS);
    }

    @deprecated('new VibrationMock()')
    static instance(): any {
      return new VibrationMock();
    }
}
github stonelasley / ionic-mocks / src / angular / platform.ts View on Github external
this.spyObj.width.and.returnValue(0);
        this.spyObj.doc.and.returnValue(document);
        this.spyObj.win.and.returnValue(window);
        this.spyObj.getActiveElement.and.returnValue(document['activeElement']);
        this.spyObj.raf.and.returnValue(1);
        this.spyObj.hasFocus.and.returnValue(true);
        this.spyObj.getElementComputedStyle.and.returnValue({
            paddingLeft: '10',
            paddingTop: '10',
            paddingRight: '10',
            paddingBottom: '10'
        });
        this.spyObj.timeout.and.returnValue((callback: any, timer: number) => setTimeout(callback, timer));
    }

    @deprecated('new PlatformMock()')
    public static instance(): any {
        return new PlatformMock();
    }
}

deprecated-decorator

A simple decorator for deprecated methods and properties.

MIT
Latest version published 9 years ago

Package Health Score

50 / 100
Full package analysis

Popular deprecated-decorator functions