mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 18:46:43 -06:00
Create type definition for 'deepcopy' (#4000)
This commit is contained in:
parent
2dc4696b0a
commit
2f72c38516
19 changed files with 35 additions and 18 deletions
17
src/@types/deepcopy.d.ts
vendored
Normal file
17
src/@types/deepcopy.d.ts
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
declare module 'deepcopy';
|
||||
|
||||
declare namespace deepcopy {
|
||||
type DeepcopyCustomizerValueType = 'Object';
|
||||
|
||||
type DeepcopyCustomizer<T> = (
|
||||
value: T,
|
||||
valueType: DeepcopyCustomizerValueType) => T;
|
||||
|
||||
interface DeepcopyOptions<T> {
|
||||
customizer: DeepcopyCustomizer<T>
|
||||
}
|
||||
|
||||
export function deepcopy<T>(
|
||||
value: T,
|
||||
options?: DeepcopyOptions<T> | DeepcopyCustomizer<T>): T;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import AccessToken from './access-token';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packApp } from './app';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { pack as packUser, IUser } from './user';
|
||||
|
||||
const Blocking = db.get<IBlocking>('blocking');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { pack as packFolder } from './drive-folder';
|
||||
import { pack as packUser } from './user';
|
||||
import monkDb, { nativeDbConn } from '../db/mongodb';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import DriveFile from './drive-file';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packNote } from './note';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../../../db/mongodb';
|
||||
import isObjectId from '../../../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from '../../user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../../../db/mongodb';
|
||||
import isObjectId from '../../../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from '../../user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { pack as packUser } from './user';
|
||||
import { pack as packFile } from './drive-file';
|
||||
import db from '../db/mongodb';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { pack as packUser, IUser } from './user';
|
||||
|
||||
const Mute = db.get<IMute>('mute');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import $ from 'cafy';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import Reaction from './note-reaction';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import rap from '@prezzemolo/rap';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
|
||||
const Signin = db.get<ISignin>('signin');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import rap from '@prezzemolo/rap';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
Loading…
Reference in a new issue