Workspaces refactor #86
5 changed files with 17 additions and 5 deletions
|
@ -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>;
|
type TODO = Record<string, any>;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { APIClient } from './api';
|
|
||||||
import { Endpoints } from './endpoints';
|
import { Endpoints } from './endpoints';
|
||||||
import Stream from './streaming';
|
import Stream from './streaming';
|
||||||
import { Acct } from './acct';
|
import { Acct } from './acct';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
APIClient,
|
|
||||||
Endpoints,
|
Endpoints,
|
||||||
Stream,
|
Stream,
|
||||||
Acct
|
Acct
|
||||||
};
|
};
|
||||||
|
|
||||||
export * as entities from './types';
|
export * as api from './api';
|
||||||
|
export * as entities from './entities';
|
||||||
|
|
14
test-d/api.ts
Normal file
14
test-d/api.ts
Normal file
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
|
@ -1 +0,0 @@
|
||||||
// RESERVED
|
|
Loading…
Reference in a new issue