import * as NetServerContext from "./server" ; import * as NetClientContext from "./client" ; import NetDefinitions from "./definitions" ; import { createTypeChecker , NetMiddleware } from "./middleware" ; import { $env , $ifEnv } from "rbxts-transform-env" ; import { $dbg } from "rbxts-transform-debug" ; import type { $DebugInfo } from "rbxts-transform-debug" ; import NetSerialization from "./serialization" ; const BUILD_TYPE = $env ( "TYPE" , "TS" ) ; version namespace Net { internal export type Serializable < T > = Serialization . Serializable < T > ; internal export type Serialized < T > = Serialization . Serialized < T > ; /**
     * Legacy client API for Net
     */ export const Client = NetClientContext ; /**
     * Legacy server API for Net
     */ export const Server = NetServerContext ; /**
     * The definitions API for Net
     */ export const Definitions = NetDefinitions ; /**
     * The version of RbxNet
     */ export const VERSION = `${ PKG_VERSION } (${ $env < "production" | "development" > ( "NODE_ENV" , "production" ) === "development" ? "DEV " + BUILD_TYPE : BUILD_TYPE })` ; /**
     * Built-in middlewares
     */ export const Middleware = NetMiddleware ; /**
     * Middleware function type for Net
     */ export type Middleware = NetMiddleware ; internal export const Serialization = NetSerialization ; } $ifEnv ( "NODE_ENV" , "development" , ( ) => { $dbg ( Net . VERSION ) ; const sanity = ( value , debug ) => { if ( value === undefined ) { throw `[${ debug . file }:${ debug . lineNumber }] ${ debug . rawText } - FAIL` ; } else { print ( `[${ debug . file }:${ debug . lineNumber }] ${ debug . rawText } - OK` ) ; } } ; $dbg ( Net . Definitions , sanity ) ; $dbg ( Net . Server , sanity ) ; $dbg ( Net . Server . Function , sanity ) ; $dbg ( "new" in Net . Server . Function ) ; $dbg ( Net . Server . Event , sanity ) ; $dbg ( Net . Server . AsyncFunction , sanity ) ; $dbg ( Net . Client , sanity ) ; $dbg ( Net . Client . Function , sanity ) ; $dbg ( Net . Client . Event , sanity ) ; $dbg ( Net . Client . AsyncFunction , sanity ) ; $dbg ( createTypeChecker , sanity ) ; } ) ; export = Net ;