feat: Add TypeScript definitions (#9693)

This commit is contained in:
Diamond Lewis
2025-04-15 06:59:58 -05:00
committed by GitHub
parent 39ef22d5c9
commit e86718fc59
19 changed files with 1482 additions and 36 deletions

44
types/tests.ts Normal file
View File

@@ -0,0 +1,44 @@
import ParseServer, { FileSystemAdapter } from 'parse-server';
async function server() {
// $ExpectType ParseServer
const parseServer = await ParseServer.startApp({});
// $ExpectType void
await parseServer.handleShutdown();
// $ExpectType any
parseServer.app;
// $ExpectType any
ParseServer.app({});
// $ExpectType any
ParseServer.promiseRouter({ appId: 'appId' });
// $ExpectType ParseLiveQueryServer
await ParseServer.createLiveQueryServer({}, {}, {});
// $ExpectType any
ParseServer.verifyServerUrl();
// $ExpectError
await ParseServer.startApp();
// $ExpectError
ParseServer.promiseRouter();
// $ExpectError
await ParseServer.createLiveQueryServer();
// $ExpectType ParseServer
const parseServer2 = new ParseServer({});
// $ExpectType ParseServer
await parseServer2.start();
}
function exports() {
// $ExpectType any
FileSystemAdapter;
}