How to use deprecated-decorator - 10 common examples

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 / action-sheet-controller.ts View on Github external
import deprecated from 'deprecated-decorator';
import { ActionSheetMock } from './action-sheet';
import { BaseMock } from '../base.mock';

const METHODS: string[] = [
    'create'
];

export class ActionSheetControllerMock extends BaseMock {

    constructor(actionSheet?: ActionSheetMock) {
        super('ActionSheet', METHODS);
        this.spyObj.create.and.returnValue(actionSheet || new ActionSheetMock());
    }

    @deprecated('new ActionSheetControllerMock()')
    public static instance(actionSheet?: ActionSheetMock): any {
        return new ActionSheetControllerMock(actionSheet);
    }
}
github alfa-laboratory / arui-feather / src / copyright / copyright.jsx View on Github external
import deprecated from 'deprecated-decorator';
import React from 'react';
import Type from 'prop-types';

import Link from '../link/link';

import cn from '../cn';
import performance from '../performance';

/**
 * @deprecated since v9.5.0
 *
 * Компонент копирайта: отображает данные о лицензии Альфа-Банка.
 */
@deprecated('arui-private')
@cn('copyright')
@performance()
class Copyright extends React.Component {
    static propTypes = {
        /** Дочерние элементы `Copyright`, заменяют собой стандартный текст copyright'а */
        children: Type.oneOfType([Type.arrayOf(Type.node), Type.node]),
        /** Дополнительный класс */
        className: Type.oneOfType([Type.func, Type.string]),
        /** Идентификатор компонента в DOM */
        id: Type.string,
        /** Отображение годов */
        showYears: Type.bool,
        /** Тема компонента */
        theme: Type.oneOf(['alfa-on-color', 'alfa-on-white'])
    };
github alfa-laboratory / arui-feather / src / app-menu / app-menu.jsx View on Github external
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import deprecated from 'deprecated-decorator';
import React from 'react';
import Type from 'prop-types';

import cn from '../cn';
import performance from '../performance';

/**
 * @deprecated since v9.5.0
 *
 * Компонент меню страницы.
 * Обычно используется совместно с компонентом `Page`.
 */
@deprecated('arui-private')
@cn('app')
@performance()
class AppMenu extends React.Component {
    static propTypes = {
        /** Дочерние элементы `AppMenu` */
        children: Type.oneOfType([Type.arrayOf(Type.node), Type.node]),
        /** Дополнительный класс */
        className: Type.oneOfType([Type.func, Type.string]),
        /** Идентификатор компонента в DOM */
        id: Type.string,
        /** Тема компонента */
        theme: Type.oneOf(['alfa-on-color', 'alfa-on-white'])
    };

    render(cn) {
        return (
github stonelasley / ionic-mocks / src / angular / alert-controller.ts View on Github external
import deprecated from 'deprecated-decorator';
import { AlertMock } from './alert';
import { BaseMock } from '../base.mock';

const METHODS = ['create'];

export class AlertControllerMock extends BaseMock {

    constructor(alertMock?: AlertMock) {
        super('AlertController', METHODS);
        this.spyObj.create.and.returnValue(alertMock || new AlertMock());
    }

    @deprecated('new AlertControllerMock()')
    public static instance(alertMock?: AlertMock): any {
        return new AlertControllerMock(alertMock);
    }
}
github alfa-laboratory / arui-feather / src / error-page / error-page.jsx View on Github external
*
 * Компонент страницы ошибки.
 * Как правило является корневым компонентом страницы.
 * Используется вместо компонента Page.
 *
 * ```javascript
 * import ErrorPage from 'arui-feather/error-page';
 * import Header from 'arui-feather/header';
 *
 *  }
 * />
 * ```
 */
@deprecated('arui-private')
@cn('error-page')
class ErrorPage extends React.Component {
    static propTypes = {
        /** Заголовок ошибки */
        title: Type.string,
        /** Сообщение ошибки */
        text: Type.string,
        /** Шапка страницы */
        header: Type.node,
        /** href для ссылки 'Вернуться в интернет-банк' */
        returnUrl: Type.string,
        /** Альтернативный текст для ссылки 'Вернуться в интернет-банк' */
        returnTitle: Type.string
    };

    static defaultProps = {
github stonelasley / ionic-mocks / src / angular / content.ts View on Github external
this['contentHeight'] = 10;
        this['contentTop'] = 10;
        this['directionX'] = 'left';
        this['directionY'] = 'up';
        this['isScrolling'] = false;
        this['scrollHeight'] = 10;
        this['scrollLeft'] = 10;
        this['scrollTop'] = 10;
        this['scrollWidth'] = 10;
        this.spyObj.getContentDimensions.and.returnValue({});
        this.spyObj.scrollTo.and.returnValue(Promise.resolve());
        this.spyObj.scrollToBottom.and.returnValue(Promise.resolve());
        this.spyObj.scrollToTop.and.returnValue(Promise.resolve());
    }

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

const METHODS = ['present', 'dismiss', 'setContent', 'setSpinner'];
export class LoadingMock extends BaseMock {
    constructor() {
        super('Loading', METHODS);
        this.spyObj.present.and.returnValue(Promise.resolve());
    }

    @deprecated('new LoadingMock()')
    public static instance(): any {
        return new LoadingMock();
    }
}
github stonelasley / ionic-mocks / src / angular / keyboard.ts View on Github external
'didShow',
    'eventsAvailable',
    'hasFocusedTextInput',
    'isOpen',
    'onClose',
    'willHide',
    'willShow'
];

export class KeyboardMock extends BaseMock {
    constructor() {
        super('Keyboard', METHODS);
        this.setReturn('isOpen', false);
    }

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

const METHODS = ['present', 'dismiss', 'onDidDismiss'];

export class AlertMock extends BaseMock {

    constructor() {
        super('Alert', METHODS);

        this.spyObj.present.and.returnValue(Promise.resolve());
    }

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

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