UNPKG

@slippi/slippi-js

Version:
1,216 lines (1,187 loc) 38.6 kB
declare function getDeathDirection(actionStateId: number): "down" | "left" | "right" | "up" | undefined; declare const animationUtils_getDeathDirection: typeof getDeathDirection; declare namespace animationUtils { export { animationUtils_getDeathDirection as getDeathDirection, }; } type CharacterColor = string; type CharacterInfo = { id: number; name: string; shortName: string; colors: CharacterColor[]; }; declare const UnknownCharacter: CharacterInfo; declare function getAllCharacters(): CharacterInfo[]; declare function getCharacterInfo(externalCharacterId: number): CharacterInfo; declare function getCharacterShortName(externalCharacterId: number): string; declare function getCharacterName(externalCharacterId: number): string; declare function getCharacterColorName(externalCharacterId: number, characterColor: number): CharacterColor; type characterUtils_CharacterColor = CharacterColor; type characterUtils_CharacterInfo = CharacterInfo; declare const characterUtils_UnknownCharacter: typeof UnknownCharacter; declare const characterUtils_getAllCharacters: typeof getAllCharacters; declare const characterUtils_getCharacterColorName: typeof getCharacterColorName; declare const characterUtils_getCharacterInfo: typeof getCharacterInfo; declare const characterUtils_getCharacterName: typeof getCharacterName; declare const characterUtils_getCharacterShortName: typeof getCharacterShortName; declare namespace characterUtils { export { characterUtils_UnknownCharacter as UnknownCharacter, characterUtils_getAllCharacters as getAllCharacters, characterUtils_getCharacterColorName as getCharacterColorName, characterUtils_getCharacterInfo as getCharacterInfo, characterUtils_getCharacterName as getCharacterName, characterUtils_getCharacterShortName as getCharacterShortName }; export type { characterUtils_CharacterColor as CharacterColor, characterUtils_CharacterInfo as CharacterInfo }; } type Aerial = { subactionIndex: number; subactionName: string; totalFrames: number; iasa: number | null; autoCancelBefore: number; autoCancelAfter: number; landingLag: number; lcancelledLandingLag: number; }; type AerialName = "fair" | "bair" | "nair" | "upair" | "dair"; declare function getAerialFrameData(internalCharacterId: number, aerialName: AerialName): Aerial | undefined; type framedataUtils_Aerial = Aerial; type framedataUtils_AerialName = AerialName; declare const framedataUtils_getAerialFrameData: typeof getAerialFrameData; declare namespace framedataUtils { export { framedataUtils_getAerialFrameData as getAerialFrameData }; export type { framedataUtils_Aerial as Aerial, framedataUtils_AerialName as AerialName }; } type Move = { id: number; name: string; shortName: string; }; declare const UnknownMove: Move; declare function getMoveInfo(moveId: number): Move; declare function getMoveShortName(moveId: number): string; declare function getMoveName(moveId: number): string; type moveUtils_Move = Move; declare const moveUtils_UnknownMove: typeof UnknownMove; declare const moveUtils_getMoveInfo: typeof getMoveInfo; declare const moveUtils_getMoveName: typeof getMoveName; declare const moveUtils_getMoveShortName: typeof getMoveShortName; declare namespace moveUtils { export { moveUtils_UnknownMove as UnknownMove, moveUtils_getMoveInfo as getMoveInfo, moveUtils_getMoveName as getMoveName, moveUtils_getMoveShortName as getMoveShortName }; export type { moveUtils_Move as Move }; } type StageMode = "vs" | "target-test" | "home-run-contest"; type StageInfo = { id: number; name: string; mode?: StageMode; }; declare const UnknownStage: StageInfo; declare function getStageInfo(stageId: number): StageInfo; declare function getStageName(stageId: number): string; declare function getStages(mode?: "all" | StageMode): StageInfo[]; type stageUtils_StageInfo = StageInfo; declare const stageUtils_UnknownStage: typeof UnknownStage; declare const stageUtils_getStageInfo: typeof getStageInfo; declare const stageUtils_getStageName: typeof getStageName; declare const stageUtils_getStages: typeof getStages; declare namespace stageUtils { export { stageUtils_UnknownStage as UnknownStage, stageUtils_getStageInfo as getStageInfo, stageUtils_getStageName as getStageName, stageUtils_getStages as getStages }; export type { stageUtils_StageInfo as StageInfo }; } declare enum Character { CAPTAIN_FALCON = 0, DONKEY_KONG = 1, FOX = 2, GAME_AND_WATCH = 3, KIRBY = 4, BOWSER = 5, LINK = 6, LUIGI = 7, MARIO = 8, MARTH = 9, MEWTWO = 10, NESS = 11, PEACH = 12, PIKACHU = 13, ICE_CLIMBERS = 14, JIGGLYPUFF = 15, SAMUS = 16, YOSHI = 17, ZELDA = 18, SHEIK = 19, FALCO = 20, YOUNG_LINK = 21, DR_MARIO = 22, ROY = 23, PICHU = 24, GANONDORF = 25, MASTER_HAND = 26, WIREFRAME_MALE = 27, WIREFRAME_FEMALE = 28, GIGA_BOWSER = 29, CRAZY_HAND = 30, SANDBAG = 31, POPO = 32 } declare enum Stage { FOUNTAIN_OF_DREAMS = 2, POKEMON_STADIUM = 3, PEACHS_CASTLE = 4, KONGO_JUNGLE = 5, BRINSTAR = 6, CORNERIA = 7, YOSHIS_STORY = 8, ONETT = 9, MUTE_CITY = 10, RAINBOW_CRUISE = 11, JUNGLE_JAPES = 12, GREAT_BAY = 13, HYRULE_TEMPLE = 14, BRINSTAR_DEPTHS = 15, YOSHIS_ISLAND = 16, GREEN_GREENS = 17, FOURSIDE = 18, MUSHROOM_KINGDOM = 19, MUSHROOM_KINGDOM_2 = 20, VENOM = 22, POKE_FLOATS = 23, BIG_BLUE = 24, ICICLE_MOUNTAIN = 25, ICETOP = 26, FLAT_ZONE = 27, DREAMLAND = 28, YOSHIS_ISLAND_N64 = 29, KONGO_JUNGLE_N64 = 30, BATTLEFIELD = 31, FINAL_DESTINATION = 32, TARGET_TEST_MARIO = 33, TARGET_TEST_CAPTAIN_FALCON = 34, TARGET_TEST_YOUNG_LINK = 35, TARGET_TEST_DONKEY_KONG = 36, TARGET_TEST_DR_MARIO = 37, TARGET_TEST_FALCO = 38, TARGET_TEST_FOX = 39, TARGET_TEST_ICE_CLIMBERS = 40, TARGET_TEST_KIRBY = 41, TARGET_TEST_BOWSER = 42, TARGET_TEST_LINK = 43, TARGET_TEST_LUIGI = 44, TARGET_TEST_MARTH = 45, TARGET_TEST_MEWTWO = 46, TARGET_TEST_NESS = 47, TARGET_TEST_PEACH = 48, TARGET_TEST_PICHU = 49, TARGET_TEST_PIKACHU = 50, TARGET_TEST_JIGGLYPUFF = 51, TARGET_TEST_SAMUS = 52, TARGET_TEST_SHEIK = 53, TARGET_TEST_YOSHI = 54, TARGET_TEST_ZELDA = 55, TARGET_TEST_GAME_AND_WATCH = 56, TARGET_TEST_ROY = 57, TARGET_TEST_GANONDORF = 58, RACE_TO_THE_FINISH = 82, GRAB_THE_TROPHIES = 83, HOME_RUN_CONTEST = 84, ALL_STAR_LOBBY = 85, EVENT_ONE = 202, EVENT_EIGHTEEN = 203, EVENT_THREE = 204, EVENT_FOUR = 205, EVENT_FIVE = 206, EVENT_SIX = 207, EVENT_SEVEN = 208, EVENT_EIGHT = 209, EVENT_NINE = 210, EVENT_TEN_PART_ONE = 211, EVENT_ELEVEN = 212, EVENT_TWELVE = 213, EVENT_THIRTEEN = 214, EVENT_FOURTEEN = 215, EVENT_THIRTY_SEVEN = 216, EVENT_SIXTEEN = 217, EVENT_SEVENTEEN = 218, EVENT_TWO = 219, EVENT_NINETEEN = 220, EVENT_TWENTY_PART_ONE = 221, EVENT_TWENTY_ONE = 222, EVENT_TWENTY_TWO = 223, EVENT_TWENTY_SEVEN = 224, EVENT_TWENTY_FOUR = 225, EVENT_TWENTY_FIVE = 226, EVENT_TWENTY_SIX = 227, EVENT_TWENTY_THREE = 228, EVENT_TWENTY_EIGHT = 229, EVENT_TWENTY_NINE = 230, EVENT_THIRTY_PART_ONE = 231, EVENT_THIRTY_ONE = 232, EVENT_THIRTY_TWO = 233, EVENT_THIRTY_THREE = 234, EVENT_THIRTY_FOUR = 235, EVENT_FORTY_EIGHT = 236, EVENT_THIRTY_SIX_PART_ONE = 237, EVENT_FIFTEEN = 238, EVENT_THIRTY_EIGHT = 239, EVENT_THIRTY_NINE = 240, EVENT_FORTY_PART_ONE = 241, EVENT_FORTY_ONE = 242, EVENT_FORTY_TWO = 243, EVENT_FORTY_THREE = 244, EVENT_FORTY_FOUR = 245, EVENT_FORTY_FIVE = 246, EVENT_FORTY_SIX = 247, EVENT_FORTY_SEVEN = 248, EVENT_THIRTY_FIVE = 249, EVENT_FORTY_NINE_PART_ONE = 250, EVENT_FIFTY = 251, EVENT_FIFTY_ONE = 252, EVENT_TEN_PART_TWO = 253, EVENT_TEN_PART_THREE = 254, EVENT_TEN_PART_FOUR = 255, EVENT_TEN_PART_FIVE = 256, EVENT_TWENTY_PART_TWO = 257, EVENT_TWENTY_PART_THREE = 258, EVENT_TWENTY_PART_FOUR = 259, EVENT_TWENTY_PART_FIVE = 260, EVENT_THIRTY_PART_TWO = 261, EVENT_THIRTY_PART_THREE = 262, EVENT_THIRTY_PART_FOUR = 263, EVENT_FORTY_PART_TWO = 264, EVENT_FORTY_PART_THREE = 265, EVENT_FORTY_PART_FOUR = 266, EVENT_FORTY_PART_FIVE = 267, EVENT_FORTY_NINE_PART_TWO = 268, EVENT_FORTY_NINE_PART_THREE = 269, EVENT_FORTY_NINE_PART_FOUR = 270, EVENT_FORTY_NINE_PART_FIVE = 271, EVENT_FORTY_NINE_PART_SIX = 272, EVENT_THIRTY_SIX_PART_TWO = 273, MULTI_MAN_MELEE = 285 } declare enum MoveId { MISC = 1, JAB_1 = 2, JAB_2 = 3, JAB_3 = 4, RAPID_JABS = 5, DASH_ATTACK = 6, F_TILT = 7, U_TILT = 8, D_TILT = 9, F_SMASH = 10, U_SMASH = 11, D_SMASH = 12, NEUTRAL_AIR = 13, F_AIR = 14, B_AIR = 15, U_AIR = 16, D_AIR = 17, NEUTRAL_SPECIAL = 18, F_SPECIAL = 19, U_SPECIAL = 20, D_SPECIAL = 21, GETUP = 50, GETUP_SLOW = 51, GRAB_PUMMEL = 52, F_THROW = 53, B_THROW = 54, U_THROW = 55, D_THROW = 56, EDGE_SLOW = 61, EDGE = 62 } declare enum Command { SPLIT_MESSAGE = 16, MESSAGE_SIZES = 53, GAME_START = 54, PRE_FRAME_UPDATE = 55, POST_FRAME_UPDATE = 56, GAME_END = 57, FRAME_START = 58, ITEM_UPDATE = 59, FRAME_BOOKEND = 60, GECKO_LIST = 61, FOD_PLATFORM = 63, WHISPY = 64, STADIUM_TRANSFORMATION = 65 } type ControllerFixType = "None" | "Mixed" | "UCF" | "Dween"; type PlayerType = { playerIndex: number; port: number; characterId: number | undefined; type: number | undefined; startStocks: number | undefined; characterColor: number | undefined; teamShade: number | undefined; handicap: number | undefined; teamId: number | undefined; staminaMode: boolean | undefined; silentCharacter: boolean | undefined; invisible: boolean | undefined; lowGravity: boolean | undefined; blackStockIcon: boolean | undefined; metal: boolean | undefined; startOnAngelPlatform: boolean | undefined; rumbleEnabled: boolean | undefined; cpuLevel: number | undefined; offenseRatio: number | undefined; defenseRatio: number | undefined; modelScale: number | undefined; controllerFix: ControllerFixType | undefined; nametag: string; displayName: string; connectCode: string; userId: string; }; declare enum GameMode { VS = 2, ONLINE = 8, TARGET_TEST = 15, HOME_RUN_CONTEST = 32 } declare enum Language { JAPANESE = 0, ENGLISH = 1 } type GameStartType = { slpVersion: string | undefined; timerType: TimerType | undefined; inGameMode: number | undefined; friendlyFireEnabled: boolean | undefined; isTeams: boolean | undefined; stageId: number | undefined; startingTimerSeconds: number | undefined; itemSpawnBehavior: ItemSpawnType | undefined; enabledItems: number | undefined; players: PlayerType[]; scene: number | undefined; gameMode: GameMode | undefined; language: Language | undefined; gameInfoBlock: GameInfoType | undefined; randomSeed: number | undefined; isPAL: boolean | undefined; isFrozenPS: boolean | undefined; matchInfo: MatchInfo | undefined; }; type MatchInfo = { sessionId: string | undefined; gameNumber: number | undefined; tiebreakerNumber: number | undefined; /** @deprecated since version 7.2.0. use sessionId instead */ matchId: string | undefined; }; type FrameStartType = { frame: number | undefined; seed: number | undefined; sceneFrameCounter: number | undefined; }; type GameInfoType = { gameBitfield1: number | undefined; gameBitfield2: number | undefined; gameBitfield3: number | undefined; gameBitfield4: number | undefined; bombRainEnabled: boolean | undefined; selfDestructScoreValue: number | undefined; itemSpawnBitfield1: number | undefined; itemSpawnBitfield2: number | undefined; itemSpawnBitfield3: number | undefined; itemSpawnBitfield4: number | undefined; itemSpawnBitfield5: number | undefined; damageRatio: number | undefined; }; declare enum TimerType { NONE = 0, DECREASING = 2, INCREASING = 3 } declare enum ItemSpawnType { OFF = 255, VERY_LOW = 0, LOW = 1, MEDIUM = 2, HIGH = 3, VERY_HIGH = 4 } declare enum EnabledItemType { METAL_BOX = 1, CLOAKING_DEVICE = 2, POKEBALL = 4, UNKNOWN_ITEM_BIT_4 = 8, UNKNOWN_ITEM_BIT_5 = 16, UNKNOWN_ITEM_BIT_6 = 32, UNKNOWN_ITEM_BIT_7 = 64, UNKNOWN_ITEM_BIT_8 = 128, FAN = 256, FIRE_FLOWER = 512, SUPER_MUSHROOM = 1024, POISON_MUSHROOM = 2048, HAMMER = 4096, WARP_STAR = 8192, SCREW_ATTACK = 16384, BUNNY_HOOD = 32768, RAY_GUN = 65536, FREEZIE = 131072, FOOD = 262144, MOTION_SENSOR_BOMB = 524288, FLIPPER = 1048576, SUPER_SCOPE = 2097152, STAR_ROD = 4194304, LIPS_STICK = 8388608, HEART_CONTAINER = 16777216, MAXIM_TOMATO = 33554432, STARMAN = 67108864, HOME_RUN_BAT = 134217728, BEAM_SWORD = 268435456, PARASOL = 536870912, GREEN_SHELL = 1073741824, RED_SHELL = 2147483648, CAPSULE = 4294967296, BOX = 8589934592, BARREL = 17179869184, EGG = 34359738368, PARTY_BALL = 68719476736, BARREL_CANNON = 137438953472, BOMB_OMB = 274877906944, MR_SATURN = 549755813888 } type PreFrameUpdateType = { frame: number | undefined; playerIndex: number | undefined; isFollower: boolean | undefined; seed: number | undefined; actionStateId: number | undefined; positionX: number | undefined; positionY: number | undefined; facingDirection: number | undefined; joystickX: number | undefined; joystickY: number | undefined; cStickX: number | undefined; cStickY: number | undefined; trigger: number | undefined; buttons: number | undefined; physicalButtons: number | undefined; physicalLTrigger: number | undefined; physicalRTrigger: number | undefined; rawJoystickX: number | undefined; percent: number | undefined; }; type PostFrameUpdateType = { frame: number | undefined; playerIndex: number | undefined; isFollower: boolean | undefined; internalCharacterId: number | undefined; actionStateId: number | undefined; positionX: number | undefined; positionY: number | undefined; facingDirection: number | undefined; percent: number | undefined; shieldSize: number | undefined; lastAttackLanded: number | undefined; currentComboCount: number | undefined; lastHitBy: number | undefined; stocksRemaining: number | undefined; actionStateCounter: number | undefined; miscActionState: number | undefined; isAirborne: boolean | undefined; lastGroundId: number | undefined; jumpsRemaining: number | undefined; lCancelStatus: number | undefined; hurtboxCollisionState: number | undefined; selfInducedSpeeds: SelfInducedSpeedsType | undefined; hitlagRemaining: number | undefined; animationIndex: number | undefined; instanceHitBy: number | undefined; instanceId: number | undefined; }; type SelfInducedSpeedsType = { airX: number | undefined; y: number | undefined; attackX: number | undefined; attackY: number | undefined; groundX: number | undefined; }; type ItemUpdateType = { frame: number | undefined; typeId: number | undefined; state: number | undefined; facingDirection: number | undefined; velocityX: number | undefined; velocityY: number | undefined; positionX: number | undefined; positionY: number | undefined; damageTaken: number | undefined; expirationTimer: number | undefined; spawnId: number | undefined; missileType: number | undefined; turnipFace: number | undefined; chargeShotLaunched: number | undefined; chargePower: number | undefined; owner: number | undefined; instanceId: number | undefined; }; type FrameBookendType = { frame: number | undefined; latestFinalizedFrame: number | undefined; }; declare enum GameEndMethod { UNRESOLVED = 0, RESOLVED = 3, TIME = 1, GAME = 2, NO_CONTEST = 7 } type GameEndType = { gameEndMethod: GameEndMethod | undefined; lrasInitiatorIndex: number | undefined; placements: PlacementType[]; }; type PlacementType = { playerIndex: number; position: number | undefined; }; type GeckoListType = { codes: GeckoCodeType[]; contents: Uint8Array; }; type GeckoCodeType = { type: number | undefined; address: number | undefined; contents: Uint8Array; }; declare enum FodPlatformSide { RIGHT = 0, LEFT = 1 } type FodPlatformType = { frame: number | undefined; platform: FodPlatformSide | undefined; height: number | undefined; }; declare enum WhispyBlowDirection { NONE = 0, LEFT = 1, RIGHT = 2 } type WhispyType = { frame: number | undefined; direction: WhispyBlowDirection | undefined; }; declare enum StadiumTransformation { FIRE = 3, GRASS = 4, NORMAL = 5, ROCK = 6, WATER = 9 } declare enum StadiumTransformationEvent { INITIATE = 2, ON_MONITOR = 3, RECEDING = 4, RISING = 5, FINISH = 6 } type StadiumTransformationType = { frame: number | undefined; event: StadiumTransformationEvent | undefined; transformation: StadiumTransformation | undefined; }; type MetadataType = { startAt?: string | null; playedOn?: "dolphin" | "network" | "nintendont" | null; lastFrame?: number | null; players?: { [playerIndex: number]: { characters: { [internalCharacterId: number]: number; }; names?: { netplay?: string | null; code?: string | null; }; }; } | null; consoleNick?: string | null; }; type EventPayloadTypes = GameStartType | FrameStartType | PreFrameUpdateType | PostFrameUpdateType | ItemUpdateType | FrameBookendType | GameEndType | GeckoListType | FodPlatformType | WhispyType | StadiumTransformationType; type EventCallbackFunc = (command: Command, payload?: EventPayloadTypes, buffer?: Uint8Array) => boolean; type StageEventTypes = FodPlatformType | WhispyType | StadiumTransformationType; type FrameEntryType = { frame: number; start: FrameStartType | undefined; players: { [playerIndex: number]: { pre: PreFrameUpdateType; post: PostFrameUpdateType; } | undefined; }; followers: { [playerIndex: number]: { pre: PreFrameUpdateType; post: PostFrameUpdateType; } | undefined; }; items: ItemUpdateType[] | undefined; stageEvents: StageEventTypes[] | undefined; }; declare enum Frames { FIRST = -123, FIRST_PLAYABLE = -39 } type FramesType = { [frameIndex: number]: FrameEntryType; }; type RollbackFramesType = { [frameIndex: number]: FrameEntryType[]; }; type RollbackFrames = { frames: RollbackFramesType; count: number; lengths: number[]; }; type StatsType = { gameComplete: boolean; lastFrame: number; playableFrameCount: number; stocks: StockType[]; conversions: ConversionType[]; combos: ComboType[]; actionCounts: ActionCountsType[]; overall: OverallType[]; }; type StadiumStatsType = HomeRunContestResultType | TargetTestResultType; type TargetTestResultType = { type: "target-test"; targetBreaks: TargetBreakType[]; }; type HomeRunContestResultType = { type: "home-run-contest"; distance: number; units: "feet" | "meters"; }; type RatioType = { count: number; total: number; ratio: number | undefined; }; type PlayerIndexedType = { playerIndex: number; opponentIndex: number; }; type DurationType = { startFrame: number; endFrame: number | undefined; }; type DamageType = { startPercent: number; currentPercent: number; endPercent: number | undefined; }; type StockType = DurationType & DamageType & { playerIndex: number; count: number; deathAnimation: number | undefined; }; type MoveLandedType = { playerIndex: number; frame: number; moveId: number; hitCount: number; damage: number; }; type ComboType = DurationType & DamageType & { playerIndex: number; moves: MoveLandedType[]; didKill: boolean; lastHitBy: number | undefined; }; type TargetBreakType = { spawnId: number; frameDestroyed: number | undefined; positionX: number; positionY: number; }; type ConversionType = ComboType & { openingType: string; }; type ActionCountsType = { playerIndex: number; wavedashCount: number; wavelandCount: number; airDodgeCount: number; dashDanceCount: number; spotDodgeCount: number; ledgegrabCount: number; rollCount: number; tauntCount: number; edgeCancelCount: { success: number; slow: number; }; lCancelCount: { success: number; fail: number; }; attackCount: { jab1: number; jab2: number; jab3: number; jabm: number; dash: number; ftilt: number; utilt: number; dtilt: number; fsmash: number; usmash: number; dsmash: number; nair: number; fair: number; bair: number; uair: number; dair: number; }; grabCount: { success: number; fail: number; }; throwCount: { up: number; forward: number; back: number; down: number; }; groundTechCount: { away: number; in: number; neutral: number; fail: number; }; wallTechCount: { success: number; fail: number; }; }; type InputCountsType = { buttons: number; triggers: number; joystick: number; cstick: number; total: number; }; type OverallType = { playerIndex: number; inputCounts: InputCountsType; conversionCount: number; totalDamage: number; killCount: number; successfulConversions: RatioType; inputsPerMinute: RatioType; digitalInputsPerMinute: RatioType; openingsPerKill: RatioType; damagePerOpening: RatioType; neutralWinRatio: RatioType; counterHitRatio: RatioType; beneficialTradeRatio: RatioType; }; declare const State: { readonly DAMAGE_START: 75; readonly DAMAGE_END: 91; readonly CAPTURE_START: 223; readonly CAPTURE_END: 232; readonly GUARD_START: 178; readonly GUARD_END: 182; readonly GROUNDED_CONTROL_START: 14; readonly GROUNDED_CONTROL_END: 24; readonly SQUAT_START: 39; readonly SQUAT_END: 41; readonly DOWN_START: 183; readonly DOWN_END: 198; readonly TECH_START: 199; readonly TECH_END: 204; readonly DYING_START: 0; readonly DYING_END: 10; readonly CONTROLLED_JUMP_START: 24; readonly CONTROLLED_JUMP_END: 34; readonly GROUND_ATTACK_START: 44; readonly GROUND_ATTACK_END: 64; readonly AERIAL_ATTACK_START: 65; readonly AERIAL_LANDING_START: 70; readonly AERIAL_LANDING_END: 74; readonly ATTACK_FTILT_START: 51; readonly ATTACK_FTILT_END: 55; readonly ATTACK_FSMASH_START: 58; readonly ATTACK_FSMASH_END: 62; readonly ROLL_FORWARD: 233; readonly ROLL_BACKWARD: 234; readonly SPOT_DODGE: 235; readonly AIR_DODGE: 236; readonly ACTION_WAIT: 14; readonly ACTION_DASH: 20; readonly ACTION_KNEE_BEND: 24; readonly GUARD_ON: 178; readonly TECH_MISS_UP: 183; readonly JAB_RESET_UP: 185; readonly TECH_MISS_DOWN: 191; readonly JAB_RESET_DOWN: 193; readonly NEUTRAL_TECH: 199; readonly FORWARD_TECH: 200; readonly BACKWARD_TECH: 201; readonly WALL_TECH: 202; readonly MISSED_WALL_TECH: 247; readonly DASH: 20; readonly TURN: 18; readonly LANDING_FALL_SPECIAL: 43; readonly JUMP_FORWARD: 25; readonly JUMP_BACKWARD: 26; readonly FALL: 29; readonly FALL_FORWARD: 30; readonly FALL_BACKWARD: 31; readonly GRAB: 212; readonly DASH_GRAB: 214; readonly GRAB_WAIT: 216; readonly PUMMEL: 217; readonly CLIFF_CATCH: 252; readonly THROW_UP: 221; readonly THROW_FORWARD: 219; readonly THROW_DOWN: 222; readonly THROW_BACK: 220; readonly DAMAGE_FALL: 38; readonly ATTACK_JAB1: 44; readonly ATTACK_JAB2: 45; readonly ATTACK_JAB3: 46; readonly ATTACK_JABM: 47; readonly ATTACK_DASH: 50; readonly ATTACK_UTILT: 56; readonly ATTACK_DTILT: 57; readonly ATTACK_USMASH: 63; readonly ATTACK_DSMASH: 64; readonly AERIAL_NAIR: 65; readonly AERIAL_FAIR: 66; readonly AERIAL_BAIR: 67; readonly AERIAL_UAIR: 68; readonly AERIAL_DAIR: 69; readonly AERIAL_NAIR_LANDING: 70; readonly AERIAL_FAIR_LANDING: 71; readonly AERIAL_BAIR_LANDING: 72; readonly AERIAL_UAIR_LANDING: 73; readonly AERIAL_DAIR_LANDING: 74; readonly TEETER: 245; readonly TAUNT_LEFT: 264; readonly TAUNT_RIGHT: 265; readonly GNW_JAB1: 341; readonly GNW_JABM: 342; readonly GNW_DTILT: 345; readonly GNW_FSMASH: 346; readonly GNW_NAIR: 347; readonly GNW_BAIR: 348; readonly GNW_UAIR: 349; readonly PEACH_FSMASH1: 349; readonly PEACH_FSMASH2: 350; readonly PEACH_FSMASH3: 351; readonly BARREL_WAIT: 293; readonly COMMAND_GRAB_RANGE1_START: 266; readonly COMMAND_GRAB_RANGE1_END: 304; readonly COMMAND_GRAB_RANGE2_START: 327; readonly COMMAND_GRAB_RANGE2_END: 338; }; type State = number; declare const Timers: { PUNISH_RESET_FRAMES: number; RECOVERY_RESET_FRAMES: number; COMBO_STRING_RESET_FRAMES: number; }; declare function getSinglesPlayerPermutationsFromSettings(settings: GameStartType): PlayerIndexedType[]; declare function didLoseStock(frame: PostFrameUpdateType, prevFrame: PostFrameUpdateType): boolean; declare function isInControl(state: number): boolean; declare function isTeching(state: number): boolean; declare function isDown(state: number): boolean; declare function isDamaged(state: number): boolean; declare function isGrabbed(state: number): boolean; declare function isCommandGrabbed(state: number): boolean; declare function isDead(state: number): boolean; declare function calcDamageTaken(frame: PostFrameUpdateType, prevFrame: PostFrameUpdateType): number; declare class ActionsComputer implements StatComputer<ActionCountsType[]> { private playerPermutations; private state; setup(settings: GameStartType): void; processFrame(frame: FrameEntryType): void; fetch(): ActionCountsType[]; } type EventMap = Record<string, unknown>; declare class TypedEventEmitter<E extends EventMap> { private listeners; on<K extends keyof E>(type: K, listener: (data: E[K]) => void): () => void; once<K extends keyof E>(type: K, listener: (data: E[K]) => void): () => void; off<K extends keyof E>(type: K, listener: (data: E[K]) => void): void; removeListener<K extends keyof E>(type: K, listener: (data: E[K]) => void): void; emit<K extends keyof E>(type: K, data: E[K]): void; } interface StatComputer<T> { setup(settings: GameStartType): void; processFrame(newFrame: FrameEntryType, allFrames: FramesType): void; fetch(): T; } type StatOptions = { processOnTheFly: boolean; }; declare class Stats { private options; private lastProcessedFrame?; private frames; private players; private allComputers; constructor(options?: StatOptions); /** * Should reset the frames to their default values. */ setup(settings: GameStartType): void; register(...computer: StatComputer<unknown>[]): void; process(): void; addFrame(frame: FrameEntryType): void; } declare const ComboEvent: { readonly COMBO_START: "COMBO_START"; readonly COMBO_EXTEND: "COMBO_EXTEND"; readonly COMBO_END: "COMBO_END"; }; type ComboEvent = (typeof ComboEvent)[keyof typeof ComboEvent]; type ComboEventData = { combo: ComboType | undefined; settings: GameStartType | undefined; }; type ComboEventMap = { [ComboEvent.COMBO_START]: ComboEventData; [ComboEvent.COMBO_EXTEND]: ComboEventData; [ComboEvent.COMBO_END]: ComboEventData; }; declare class ComboComputer extends TypedEventEmitter<ComboEventMap> implements StatComputer<ComboType[]> { private playerPermutations; private state; private combos; private settings?; setup(settings: GameStartType): void; processFrame(frame: FrameEntryType, allFrames: FramesType): void; fetch(): ComboType[]; } type ConversionEventData = { combo: ConversionType | undefined; settings: GameStartType | undefined; }; type ConversionEventMap = { CONVERSION: ConversionEventData; }; declare class ConversionComputer extends TypedEventEmitter<ConversionEventMap> implements StatComputer<ConversionType[]> { private playerPermutations; private conversions; private state; private metadata; private settings?; constructor(); setup(settings: GameStartType): void; processFrame(frame: FrameEntryType, allFrames: FramesType): void; fetch(): ConversionType[]; private _populateConversionTypes; } type PlayerInput = { playerIndex: number; opponentIndex: number; inputCount: number; joystickInputCount: number; cstickInputCount: number; buttonInputCount: number; triggerInputCount: number; }; declare class InputComputer implements StatComputer<PlayerInput[]> { private state; private playerPermutations; setup(settings: GameStartType): void; processFrame(frame: FrameEntryType, allFrames: FramesType): void; fetch(): PlayerInput[]; } declare function generateOverallStats({ settings, inputs, conversions, playableFrameCount, }: { settings: GameStartType; inputs: PlayerInput[]; conversions: ConversionType[]; playableFrameCount: number; }): OverallType[]; declare class StockComputer implements StatComputer<StockType[]> { private state; private playerPermutations; private stocks; setup(settings: GameStartType): void; processFrame(frame: FrameEntryType, allFrames: FramesType): void; fetch(): StockType[]; } declare class TargetBreakComputer implements StatComputer<TargetBreakType[]> { private targetBreaks; private isTargetTestGame; setup(settings: GameStartType): void; processFrame(frame: FrameEntryType, allFrames: FramesType): void; fetch(): TargetBreakType[]; } declare function frameToGameTimer(frame: number, options: Pick<GameStartType, "timerType" | "startingTimerSeconds">): string; declare const MAX_ROLLBACK_FRAMES = 7; declare const SlpParserEvent: { readonly SETTINGS: "settings"; readonly END: "end"; readonly FRAME: "frame"; readonly FINALIZED_FRAME: "finalized-frame"; readonly ROLLBACK_FRAME: "rollback-frame"; }; type SlpParserEvent = (typeof SlpParserEvent)[keyof typeof SlpParserEvent]; declare const defaultSlpParserOptions: { strict: boolean; }; type SlpParserOptions = typeof defaultSlpParserOptions; type SlpParserEventMap = { [SlpParserEvent.SETTINGS]: GameStartType; [SlpParserEvent.END]: GameEndType; [SlpParserEvent.FRAME]: FrameEntryType; [SlpParserEvent.FINALIZED_FRAME]: FrameEntryType; [SlpParserEvent.ROLLBACK_FRAME]: FrameEntryType; }; declare class SlpParser extends TypedEventEmitter<SlpParserEventMap> { private frames; private rollbackCounter; private settings?; private gameEnd?; private latestFrameIndex?; private settingsComplete; private lastFinalizedFrame; private options; private geckoList?; constructor(options?: Partial<SlpParserOptions>); handleCommand(command: Command, payload: any): void; /** * Resets the parser state to their default values. */ reset(): void; getLatestFrameNumber(): number; getPlayableFrameCount(): number; getLatestFrame(): FrameEntryType | undefined; getSettings(): GameStartType | undefined; getItems(): EnabledItemType[] | undefined; getGameEnd(): GameEndType | undefined; getFrames(): FramesType; getRollbackFrames(): RollbackFrames; getFrame(num: number): FrameEntryType | undefined; getGeckoList(): GeckoListType | undefined; private _handleGeckoList; private _handleGameEnd; private _handleGameStart; private _handleFrameStart; private _handlePostFrameUpdate; private _handleFrameUpdate; private _handleItemUpdate; private _handleFrameBookend; private _handleStageEvent; /** * Fires off the FINALIZED_FRAME event for frames up until a certain number * @param num The frame to finalize until */ private _finalizeFrames; private _completeSettings; } declare const NETWORK_MESSAGE = "HELO\0"; declare enum SlpStreamMode { AUTO = "AUTO",// Always reading data, but errors on invalid command MANUAL = "MANUAL" } declare const defaultSettings: { suppressErrors: boolean; mode: SlpStreamMode; }; type SlpStreamSettings = typeof defaultSettings; type MessageSizes = Map<Command, number>; type SlpCommandEventPayload = { command: Command; payload: EventPayloadTypes | MessageSizes; }; type SlpRawEventPayload = { command: Command; payload: Uint8Array; }; declare const SlpStreamEvent: { readonly RAW: "slp-raw"; readonly COMMAND: "slp-command"; }; type SlpStreamEvent = (typeof SlpStreamEvent)[keyof typeof SlpStreamEvent]; type SlpStreamEventMap = { [SlpStreamEvent.RAW]: SlpRawEventPayload; [SlpStreamEvent.COMMAND]: SlpCommandEventPayload; }; /** * SlpStream processes a stream of Slippi data and emits events based on the commands received. * * SlpStream emits two events: "slp-raw" and "slp-command". The "slp-raw" event emits the raw buffer * bytes whenever it processes each command. You can manually parse this or write it to a * file. The "slp-command" event returns the parsed payload which you can access the attributes. * * @class SlpStream * @extends {TypedEventEmitter} */ declare class SlpStream extends TypedEventEmitter<SlpStreamEventMap> { private gameEnded; private settings; private payloadSizes?; private previousBuffer; private readonly utf8Decoder; /** *Creates an instance of SlpStream. * @param {Partial<SlpStreamSettings>} [slpOptions] * @memberof SlpStream */ constructor(slpOptions?: Partial<SlpStreamSettings>); restart(): void; /** * Process a chunk of data. This is the main entry point for feeding data * into the stream processor. */ process(newData: Uint8Array): void; private _writeCommand; private _processCommand; } type BinaryLike = ArrayBuffer | ArrayBufferView; interface SlpInputRef { read(targetBuffer: Uint8Array, offset: number, length: number, position: number): number; size(): number; open(): void; close(): void; } /** * Slippi Game class that wraps a file */ declare abstract class SlippiGameBase { private readonly input; private metadata?; private finalStats?; private readPosition?; private parser; private actionsComputer; private conversionComputer; private comboComputer; private stockComputer; private inputComputer; private targetBreakComputer; protected statsComputer: Stats; constructor(input: SlpInputRef, opts?: StatOptions); private _process; /** * Gets the game settings, these are the settings that describe the starting state of * the game such as characters, stage, etc. */ getSettings(): GameStartType | undefined; getItems(): EnabledItemType[] | undefined; getLatestFrame(): FrameEntryType | undefined; getGameEnd(options?: { skipProcessing?: boolean; }): GameEndType | undefined; getFrames(): FramesType; getRollbackFrames(): RollbackFrames; getGeckoList(): GeckoListType | undefined; getStats(): StatsType | undefined; getStadiumStats(): StadiumStatsType | undefined; getMetadata(): MetadataType | undefined; abstract getFilePath(): string | undefined; getWinners(): PlacementType[]; } export { Character as C, EnabledItemType as E, FodPlatformSide as F, GameEndMethod as G, InputComputer as I, Language as L, MAX_ROLLBACK_FRAMES as M, MoveId as N, NETWORK_MESSAGE as P, SlippiGameBase as S, SlpParser as a0, SlpParserEvent as a1, SlpStream as a4, SlpStreamEvent as a5, SlpStreamMode as a6, StadiumTransformation as a9, isDamaged as aA, isDead as aB, isDown as aC, isGrabbed as aD, isInControl as aE, isTeching as aF, moveUtils as aG, stageUtils as aH, TypedEventEmitter as aI, StadiumTransformationEvent as aa, Stage as ac, State as af, Stats as ag, StockComputer as ai, TargetBreakComputer as ak, TimerType as an, Timers as ao, WhispyBlowDirection as ap, animationUtils as ar, calcDamageTaken as as, characterUtils as at, didLoseStock as au, frameToGameTimer as av, framedataUtils as aw, generateOverallStats as ax, getSinglesPlayerPermutationsFromSettings as ay, isCommandGrabbed as az, ActionsComputer as b, ComboComputer as c, Command as e, ConversionComputer as g, Frames as p, GameMode as t, ItemSpawnType as y }; export type { SlpCommandEventPayload as $, ActionCountsType as A, BinaryLike as B, DamageType as D, HomeRunContestResultType as H, MessageSizes as J, MetadataType as K, MoveLandedType as O, OverallType as Q, PlacementType as R, PlayerIndexedType as T, PlayerType as U, PostFrameUpdateType as V, PreFrameUpdateType as W, RatioType as X, RollbackFrames as Y, RollbackFramesType as Z, SelfInducedSpeedsType as _, StatOptions as a, SlpParserOptions as a2, SlpRawEventPayload as a3, SlpStreamSettings as a7, StadiumStatsType as a8, StadiumTransformationType as ab, StageEventTypes as ad, StatComputer as ae, StatsType as ah, StockType as aj, TargetBreakType as al, TargetTestResultType as am, WhispyType as aq, ComboType as d, ControllerFixType as f, ConversionType as h, DurationType as i, EventCallbackFunc as j, EventPayloadTypes as k, FodPlatformType as l, FrameBookendType as m, FrameEntryType as n, FrameStartType as o, FramesType as q, GameEndType as r, GameInfoType as s, GameStartType as u, GeckoCodeType as v, GeckoListType as w, InputCountsType as x, ItemUpdateType as z };