@cybermp-community/server-types 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/exports.ts +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermp-community/server-types",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "TypeScript type definitions for the CyberMP server-side environment.",
5
5
  "license": "CC BY-SA 4.0",
6
6
  "author": {
package/src/exports.ts CHANGED
@@ -1,5 +1,12 @@
1
- export interface MpExports {
2
- [module: string]: {
3
- [name: string]: (...args: unknown[]) => unknown;
4
- };
5
- }
1
+ export type MpExports = MpExternalExports & MpCreateExport;
2
+
3
+ interface MpExternalExports {
4
+ [module: string]: {
5
+ [name: string]: <T extends unknown[] = unknown[], R = unknown>(...args: T) => R | Promise<R>;
6
+ };
7
+ }
8
+
9
+ type MpCreateExport = <T extends unknown[] = unknown[], R = unknown>(
10
+ name: string,
11
+ callback: (...args: T) => R | Promise<R>,
12
+ ) => void;