Skip to content

Commit

Permalink
feat(types): remove Constructor, Awaited, Ctor and Arr types - use @s…
Browse files Browse the repository at this point in the history
…apphire/utilities instead (#84)
  • Loading branch information
favna committed Jun 19, 2021
1 parent 0b0c322 commit 538dbb5
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 129 deletions.
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,28 @@
},
"dependencies": {
"@discordjs/collection": "^0.1.6",
"tslib": "^2.2.0"
"@sapphire/utilities": "^1.6.0",
"tslib": "^2.3.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@mdx-js/mdx": "^1.6.22",
"@sapphire/eslint-config": "^3.1.3",
"@sapphire/prettier-config": "^1.1.2",
"@sapphire/ts-config": "^2.2.2",
"@types/node": "^15.12.1",
"@sapphire/eslint-config": "^3.2.0",
"@sapphire/prettier-config": "^1.1.4",
"@sapphire/ts-config": "^2.3.0",
"@types/node": "^15.12.4",
"cz-conventional-changelog": "^3.3.0",
"husky": "^6.0.0",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
"pretty-quick": "^3.1.0",
"rollup": "^2.51.2",
"pretty-quick": "^3.1.1",
"rollup": "^2.52.1",
"rollup-plugin-dts": "^3.0.2",
"standard-version": "^9.3.0",
"typedoc": "^0.21.0-beta.1",
"typedoc": "^0.21.0",
"typedoc-plugin-nojekyll": "^1.0.1",
"typescript": "^4.3.2"
"typescript": "^4.3.4"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -96,14 +97,14 @@
"access": "public"
},
"resolutions": {
"acorn": "^8.2.4",
"acorn": "^8.4.0",
"minimist": "^1.2.5",
"kind-of": "^6.0.3",
"jest-environment-jsdom": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
"jest-jasmine2": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
"dot-prop": "^6.0.1",
"lodash": "^4.17.21",
"marked": "^2.0.3",
"marked": "^2.1.1",
"merge": "^2.1.1",
"trim": "^1.0.1",
"trim-newlines": "^3.0.1"
Expand Down
5 changes: 1 addition & 4 deletions src/lib/strategies/ILoaderStrategy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Awaited, Constructor, Ctor } from '@sapphire/utilities';
import type { Piece } from '../structures/Piece';
import type { Store } from '../structures/Store';
import type { Ctor } from './Shared';

export type Constructor<T> = new (...args: any[]) => T;
export type Awaited<T> = PromiseLike<T> | T;

/**
* The module data information.
Expand Down
12 changes: 1 addition & 11 deletions src/lib/strategies/Shared.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/**
* A readonly array of any values.
* @private
*/
export type Arr = readonly any[];

/**
* A generic constructor.
* @private
*/
export type Ctor<A extends Arr = readonly any[], R = any> = new (...args: A) => R;
import type { Ctor } from '@sapphire/utilities';

/**
* Determines whether or not a value is a class.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/structures/Piece.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Awaited } from '@sapphire/utilities';
import { container, Container } from '../shared/Container';
import type { Awaited } from '../strategies/ILoaderStrategy';
import type { Store } from './Store';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/lib/structures/Store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Collection from '@discordjs/collection';
import type { Constructor } from '@sapphire/utilities';
import { promises as fsp } from 'fs';
import { join } from 'path';
import { LoaderError, LoaderErrorType } from '../errors/LoaderError';
import { container, Container } from '../shared/Container';
import type { Constructor, ILoaderResultEntry, ILoaderStrategy, ModuleData } from '../strategies/ILoaderStrategy';
import type { ILoaderResultEntry, ILoaderStrategy, ModuleData } from '../strategies/ILoaderStrategy';
import { LoaderStrategy } from '../strategies/LoaderStrategy';
import type { Piece } from './Piece';

Expand Down
Loading

0 comments on commit 538dbb5

Please sign in to comment.