@@ -33,10 +33,7 @@ const uuidNamespace = uuidv5(homepage, uuidv5.URL);
3333 * @template Output Type of output value the procedure returns. Defaults to `undefined`.
3434 * @see [TypedEmitter](https://github.com/andywer/typed-emitter#readme)
3535 */
36- export class Procedure <
37- Input extends Nullable = undefined ,
38- Output extends Nullable = undefined
39- >
36+ export class Procedure < Input = undefined , Output = undefined >
4037 extends ( EventEmitter as {
4138 new < Input > ( ) : TypedEmitter < ProcedureEvents < Input > > ;
4239 } ) < Input >
@@ -473,27 +470,21 @@ export class Procedure<
473470}
474471export default Procedure ;
475472
476- /**
477- * Represents a nullable value.
478- */
479- export type Nullable = unknown | null | undefined ;
480-
481473/**
482474 * Represents a simple callback function which can take a single input parameter.
483475 * @template Input The type of input parameter the callback accepts. Defaults to `undefined`.
484476 * @template Output The type of output value the callback returns. Defaults to `undefined`.
485477 * @see {@link Procedure }
486478 */
487- export type Callback <
488- Input extends Nullable = undefined ,
489- Output extends Nullable = undefined
490- > = ( input : Input ) => Output ;
479+ export type Callback < Input = undefined , Output = undefined > = (
480+ input : Input
481+ ) => Output ;
491482
492483/**
493484 * A response from a {@link call Procedure call}.
494485 * If the call returned successfully, the response will be of shape `{ output: Output }`, otherwise `{ error: ProcedureError }`.
495486 */
496- export type Response < Output extends Nullable = undefined > =
487+ export type Response < Output = undefined > =
497488 | { output : Output | null | undefined ; error ?: never ; pong ?: never }
498489 | { output ?: never ; error : ProcedureError | null | undefined ; pong ?: never }
499490 | { output ?: never ; error ?: never ; pong : string } ;
@@ -599,7 +590,7 @@ export interface ProcedureCallOptions extends ProcedureOptions {
599590 * @template Input The type of input parameter passed to the data event.
600591 * @see [TypedEmitter](https://github.com/andywer/typed-emitter#readme)
601592 */
602- export type ProcedureEvents < Input extends Nullable = undefined > = {
593+ export type ProcedureEvents < Input = undefined > = {
603594 /**
604595 * Signature for the data event.
605596 * @param {Input } data The input parameter which was passed to the {@link Procedure}.
@@ -651,9 +642,9 @@ export function isPing(object: unknown): object is Ping {
651642 * @see {@link Procedure.endpoint }
652643 * @see {@link ping }
653644 */
654- export async function call < Output extends Nullable = unknown > (
645+ export async function call < Output = unknown > (
655646 endpoint : string ,
656- input ?: Nullable ,
647+ input ?: unknown ,
657648 options : Partial < ProcedureCallOptions > = { }
658649) : Promise < Output > {
659650 try {
@@ -848,9 +839,9 @@ export async function tryPing(
848839 * [then](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) handler(s).
849840 * @template Output The type of output value expected to be returned from the {@link Procedure}. Defaults to `unknown`.
850841 */
851- async function getResponse < Output extends Nullable = unknown > (
842+ async function getResponse < Output = unknown > (
852843 endpoint : string ,
853- input : Nullable ,
844+ input : unknown ,
854845 options : ProcedureCallOptions
855846) : Promise < Response < Output > > {
856847 let socket : Socket | undefined ;
0 commit comments