diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-16 18:18:45 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-16 18:18:45 +0900 |
| commit | 2f8f6431d1ff894939485c47d42775162cee740f (patch) | |
| tree | 315c529afb0dd78121b466bd605e760d3bf4a0c3 | |
| parent | add streaming test (diff) | |
| download | misskey-2f8f6431d1ff894939485c47d42775162cee740f.tar.gz misskey-2f8f6431d1ff894939485c47d42775162cee740f.tar.bz2 misskey-2f8f6431d1ff894939485c47d42775162cee740f.zip | |
:v:
| -rw-r--r-- | src/endpoints.ts | 2 | ||||
| -rw-r--r-- | src/entities.ts (renamed from src/types.ts) | 0 | ||||
| -rw-r--r-- | src/index.ts | 5 | ||||
| -rw-r--r-- | test-d/api.ts | 14 | ||||
| -rw-r--r-- | test-d/index.ts | 1 |
5 files changed, 17 insertions, 5 deletions
diff --git a/src/endpoints.ts b/src/endpoints.ts index c9f89fd438..7c0fe6b836 100644 --- a/src/endpoints.ts +++ b/src/endpoints.ts @@ -1,4 +1,4 @@ -import { ID, InstanceMetadata, Note, OriginType, Page, ServerInfo, Stats, User, UserSorting } from './types'; +import { ID, InstanceMetadata, Note, OriginType, Page, ServerInfo, Stats, User, UserSorting } from './entities'; type TODO = Record<string, any>; diff --git a/src/types.ts b/src/entities.ts index 64124f45b5..64124f45b5 100644 --- a/src/types.ts +++ b/src/entities.ts diff --git a/src/index.ts b/src/index.ts index 399f8ff1dc..b5f5a5629c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,12 @@ -import { APIClient } from './api'; import { Endpoints } from './endpoints'; import Stream from './streaming'; import { Acct } from './acct'; export { - APIClient, Endpoints, Stream, Acct }; -export * as entities from './types'; +export * as api from './api'; +export * as entities from './entities'; diff --git a/test-d/api.ts b/test-d/api.ts new file mode 100644 index 0000000000..32357c2a3b --- /dev/null +++ b/test-d/api.ts @@ -0,0 +1,14 @@ +/** + * Unit testing TypeScript types. + * with https://github.com/SamVerschueren/tsd + */ + +import { expectType } from 'tsd'; +import * as Misskey from '../src'; + +describe('API', () => { + test('returns node that has sprcified type', async () => { + const res = await Misskey.api.request('https://misskey.test', 'meta', { detail: true }, 'TOKEN'); + expectType<Misskey.entities.InstanceMetadata>(res); + }); +}); diff --git a/test-d/index.ts b/test-d/index.ts deleted file mode 100644 index e6fafcc4ff..0000000000 --- a/test-d/index.ts +++ /dev/null @@ -1 +0,0 @@ -// RESERVED |