lcinterface
Version:
An easy way to interact with the league client. This module is basically a middle layer between your app and the league client
209 lines (189 loc) • 3.88 kB
TypeScript
interface user_endpoints {
[key: string]: string
me: string
}
interface game_endpoints {
[key: string]: string
gameflow: string
session: string
champselect: string
action: string
}
interface runes_endpoints {
[key: string]: string
runes: string
spells: string
}
interface lobby_endpoints {
[key: string]: string
lobby: string,
search: string,
partytype: string,
position: string,
matchaccept: string
matchdecline: string
}
interface game_gameflow {
NONE: string
LOBBY: string
MATCHMAKING: string
READYCHECK: string
CHAMPSELECT: string
INPROGRESS: string
WAITINGFORSTATS: string
ENDOFGAME: string
}
interface game_lanes {
UNSELECTED: string,
TOP: string,
JUNGLE: string,
MIDDLE: string,
BOTTOM: string,
UTILITY: string
}
interface runes_spell {
[key: string]: { id: number, key: string, name: string }
Barrier: {
id: number,
key: string,
name: string
},
Cleanse: {
id: number,
key: string,
name: string
},
Exhaust: {
id: number,
key: string,
name: string
},
Flash: {
id: number,
key: string,
name: string
},
Ghost: {
id: number,
key: string,
name: string
},
Heal: {
id: number,
key: string,
name: string
},
Smite: {
id: number,
key: string,
name: string
},
Teleport: {
id: number,
key: string,
name: string
},
Clarity: {
id: number,
key: string,
name: string
},
Ignite: {
id: number,
key: string,
name: string
},
Mark: {
id: number,
key: string,
name: string
}
}
interface lobby_queueId {
normal: {
blind: number,
draft: number
},
ranked: {
solo_duo: number,
flex: number
},
extra: {
aram: number
}
}
interface lobby_type {
open: string,
closed: string
}
interface interface_states {
hooked: boolean,
vcc: number,
unsafe: boolean
[key: string]: unknown
}
interface base_credentials {
port: number
password: string
}
interface credentials {
protocol: string
address: string
port: number
username: string
password: string
}
type methods = "get" | "post" | "put" | "delete" | "patch"
export declare class LCIConnector {
async connect(): void
disconnect(): void
setCheckProcessInterval(time: number): void
on(event: "connect", listner: (data: {
address: string,
username: string,
port: number,
pid: number
password: string,
protocol: string
}) => void): this
on(event: "disconnect", listner: () => void): this
}
export const LCIClient: {
base64_auth: string
data: {
protocol: string
address: string
port: number
username: string
password: string
}
endpoints: {
user: user_endpoints
game: game_endpoints
runes: runes_endpoints
lobby: lobby_endpoints
}
game: {
gameflows: game_gameflow
lanes: game_lanes
spells: runes_spell
queueId: lobby_queueId
partytype: lobby_type
}
states: {
hooked: boolean,
vcc: number,
unsafe: boolean
}
allowUnsafeCalls(value: boolean): boolean
setState<T>(state: string, value: T): T
getState<T>(state: string): T | boolean
addEndpoint(group: string, name: string, endpoint: string): string | boolean
isCorrectValue<T>(state: string, value: T): boolean
async __fastvirtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T>
async virtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T>
__fasthook(credentials: base_credentials): boolean
hook(credentials: credentials): boolean
__fastunhook(): boolean
unhook(): boolean
}