0.7.9 • Published 6 months ago

@types/moment-jalaali v0.7.9

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

Installation

npm install --save @types/moment-jalaali

Summary

This package contains type definitions for moment-jalaali (https://github.com/jalaali/moment-jalaali).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/moment-jalaali.

index.d.ts

// Type definitions for moment-jalaali 0.7.0
// Project: https://github.com/jalaali/moment-jalaali
// Definitions by: Ali Taheri Moghaddar <https://github.com/alitaheri>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import moment = require('moment');

export = moment;

declare module 'moment' {
    type JUnitOfTime = 'jYear' | 'jMonth';

    interface LoadPersianOptions {
        /**
         * Use persian digits as decribed by unicode
         */
        usePersianDigits?: boolean | undefined;
        /**
         * use dialect option to change usePersian dialect, available options are:
         *      persian: default dialect(امرداد، آدینه، ...)
         *      persian-modern: modern dialect(مرداد، جمعه، ...)
         */
        dialect?: 'persian' | 'persian-modern' | undefined;
    }

    /**
     * Add persian language.
     */
    function loadPersian(options?: LoadPersianOptions): void;

    function jIsLeapYear(year: number): boolean;
    function jDaysInMonth(year: number, month: number): number;

    interface Moment {
        startOf(jUnitOfTime: JUnitOfTime): Moment;
        endOf(jUnitOfTime: JUnitOfTime): Moment;

        add(amount: string | number, jUnitOfTime: JUnitOfTime): Moment;

        subtract(amount: string | number, jUnitOfTime: JUnitOfTime): Moment;

        jYear(y: number): Moment;
        jYear(): number;
        jMonth(M: number | string): Moment;
        jMonth(): number;
        jDate(d: number): Moment;
        jDate(): number;
        jWeek(d: number): Moment;
        jWeek(): number;
        jWeekYear(d: number): Moment;
        jWeekYear(): number;
        jDayOfYear(d: number): Moment;
        jDayOfYear(): number;
    }

}

Additional Details

  • Last updated: Thu, 08 Jul 2021 18:50:55 GMT
  • Dependencies: @types/moment
  • Global values: none

Credits

These definitions were written by Ali Taheri Moghaddar.