1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-28 23:09:16 +09:00

Create new type definition for 'ms' (#4057)

* Create new type definition for 'ms'

* Follow lint
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-02 00:16:27 +09:00 committed by syuilo
parent 9c106022ae
commit da1a238be3
14 changed files with 24 additions and 13 deletions

View File

@ -63,7 +63,6 @@
"@types/mkdirp": "0.5.2",
"@types/mocha": "5.2.5",
"@types/mongodb": "3.1.19",
"@types/ms": "0.7.30",
"@types/node": "10.12.18",
"@types/nodemailer": "4.6.5",
"@types/nprogress": "0.0.29",

12
src/@types/ms.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
declare module 'ms' {
interface IMSOptions {
long: boolean;
}
function ms(value: string): number;
function ms(value: number, options?: IMSOptions): string;
namespace ms {} // Hack
export = ms;
}

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import User, { pack } from '../../../../models/user';
import Blocking from '../../../../models/blocking';
import create from '../../../../services/blocking/create';

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import User, { pack } from '../../../../models/user';
import Blocking from '../../../../models/blocking';
import deleteBlocking from '../../../../services/blocking/delete';

View File

@ -1,4 +1,4 @@
const ms = require('ms');
import * as ms from 'ms';
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
import { validateFileName, pack } from '../../../../../models/drive-file';
import create from '../../../../../services/drive/add-file';

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import { pack } from '../../../../../models/drive-file';
import uploadFromUrl from '../../../../../services/drive/upload-from-url';
import define from '../../../define';

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import User, { pack } from '../../../../models/user';
import Following from '../../../../models/following';
import create from '../../../../services/following/create';

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import User, { pack } from '../../../../models/user';
import Following from '../../../../models/following';
import deleteFollowing from '../../../../services/following/delete';

View File

@ -6,7 +6,7 @@ import * as nodemailer from 'nodemailer';
import fetchMeta from '../../../../misc/fetch-meta';
import rndstr from 'rndstr';
import config from '../../../../config';
const ms = require('ms');
import * as ms from 'ms';
import * as bcrypt from 'bcryptjs';
export const meta = {

View File

@ -3,7 +3,7 @@ import ID, { transform } from '../../../../../misc/cafy-id';
import Message from '../../../../../models/messaging-message';
import define from '../../../define';
import { publishMessagingStream } from '../../../../../stream';
const ms = require('ms');
import * as ms from 'ms';
export const meta = {
stability: 'stable',

View File

@ -1,5 +1,5 @@
import $ from 'cafy'; import ID, { transform, transformMany } from '../../../../misc/cafy-id';
const ms = require('ms');
import * as ms from 'ms';
import { length } from 'stringz';
import Note, { INote, isValidCw, pack } from '../../../../models/note';
import User, { IUser } from '../../../../models/user';

View File

@ -3,7 +3,7 @@ import Note from '../../../../models/note';
import deleteNote from '../../../../services/note/delete';
import User from '../../../../models/user';
import define from '../../define';
const ms = require('ms');
import * as ms from 'ms';
export const meta = {
stability: 'stable',

View File

@ -1,7 +1,7 @@
import * as mongo from 'mongodb';
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
import define from '../../../define';
const ms = require('ms');
import * as ms from 'ms';
import deleteReaction from '../../../../../services/note/reaction/delete';
import { IUser } from '../../../../../models/user';
import { getValiedNote } from '../../../common/getters';

View File

@ -1,4 +1,4 @@
const ms = require('ms');
import * as ms from 'ms';
import $ from 'cafy';
import User, { pack, ILocalUser } from '../../../../models/user';
import { getFriendIds } from '../../common/get-friends';