-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.lua
More file actions
55 lines (41 loc) · 2.22 KB
/
Copy pathtypes.lua
File metadata and controls
55 lines (41 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---@alias MnrDebugLevel 'debug' | 'info' | 'warn' | 'error'| 'fatal'
---@alias MnrDebugAPI fun(level: MnrDebugLevel, text: string, ...: any)
---@class CronjobAPIOptions
---@field maxDelay number
---@class MnrCronjob
---@field schedulerId number
---@field expression string
---@field stop fun(self: MnrCronjob): boolean
---@class MnrClientRPC
---@field send fun(name: string, timeout: number | false | nil, cb: function, ...: any)
---@field fetch fun(name: string, timeout: number | false | nil, ...: any): any
---@field handle fun(name: string, handler: function)
---@class TypecheckDefinition
---@field expected string
---@field required? boolean
---@field defaults? any
---@alias MnrImportAPI fun(path: string, ext: 'lua'|'json', cache?: boolean, env?: table): any
---@class MnrNumAPI
---@field clamp fun(value: number, min: number, max: number): number
---@class MnrTimestampAPI
---@field unix fun(value: string): integer Parses a DATE or DATETIME string into a Unix timestamp using the host's local time
---@field string fun(unix: integer, withTime?: boolean): string Formats a Unix timestamp back into a DATE or DATETIME string using the host's local time
---@class MnrTypecheckAPI
---@field single fun(value: any, definition: TypecheckDefinition): any?, string?
---@field schema fun(input: table, schema: table<string, TypecheckDefinition>, output?: table): table?, string?
---@class MnrServerRPC
---@field send fun(name: string, playerId: number, timeout: number | false | nil, cb: function, ...: any)
---@field fetch fun(name: string, playerId: number, timeout: number | false | nil, ...: any): any
---@field handle fun(name: string, handler: fun(playerId: number, ...: any))
---@class MnrSharedAPI
---@field debug MnrDebugAPI
---@field import MnrImportAPI
---@field num MnrNumAPI
---@field timestamp MnrTimestampAPI
---@field typecheck MnrTypecheckAPI
---@class MnrClientAPI : MnrSharedAPI
---@field rpc MnrClientRPC
---@class MnrServerAPI : MnrSharedAPI
---@field cronjob fun(expression: string, callback: fun(d: osdate), options: CronjobAPIOptions): MnrCronjob
---@field rpc MnrServerRPC
---@alias MnrAPI MnrClientAPI | MnrServerAPI