koin.js 1.0.16 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -268,6 +268,10 @@ interface UseNostalgistOptions {
268
268
  romFileName?: string;
269
269
  shader?: string;
270
270
  romId?: string;
271
+ activeCheats?: {
272
+ code: string;
273
+ desc?: string;
274
+ }[];
271
275
  }
272
276
  interface UseNostalgistReturn {
273
277
  status: EmulatorStatus;
@@ -299,12 +303,16 @@ interface UseNostalgistReturn {
299
303
  toggleMute: () => void;
300
304
  screenshot: () => Promise<string | null>;
301
305
  pressKey: (key: string) => void;
306
+ pressDown: (button: string) => void;
307
+ pressUp: (button: string) => void;
302
308
  resize: (size: {
303
309
  width: number;
304
310
  height: number;
305
311
  }) => void;
306
- applyCheat: (code: string) => void;
307
- resetCheats: () => void;
312
+ injectCheats: (cheats: {
313
+ code: string;
314
+ }[]) => void;
315
+ clearCheats: () => void;
308
316
  getNostalgistInstance: () => Nostalgist | null;
309
317
  isPerformanceMode: boolean;
310
318
  }
@@ -479,6 +487,8 @@ interface KoinTranslations {
479
487
  exit: string;
480
488
  language: string;
481
489
  selectLanguage: string;
490
+ haptics: string;
491
+ enableHaptics: string;
482
492
  };
483
493
  overlay: {
484
494
  play: string;
@@ -562,6 +572,9 @@ interface KoinTranslations {
562
572
  copy: string;
563
573
  active: string;
564
574
  toggleHint: string;
575
+ codePlaceholder: string;
576
+ descPlaceholder: string;
577
+ add: string;
565
578
  };
566
579
  saveSlots: {
567
580
  title: string;
@@ -802,14 +815,17 @@ interface ControlMapperProps {
802
815
  interface CheatModalProps {
803
816
  isOpen: boolean;
804
817
  cheats: Cheat[];
805
- activeCheats: Set<number>;
806
- onToggle: (cheatId: number) => void;
818
+ activeCheats: Set<string>;
819
+ onToggle: (cheatId: string) => void;
807
820
  onClose: () => void;
821
+ onAddManualCheat?: (code: string, description: string) => void;
808
822
  }
823
+ type CheatSource = 'database' | 'manual';
809
824
  interface Cheat {
810
- id: number;
825
+ id: string;
811
826
  code: string;
812
827
  description: string;
828
+ source?: CheatSource;
813
829
  }
814
830
  interface RAHardcodeRestrictions {
815
831
  isHardcore?: boolean;
@@ -1097,4 +1113,4 @@ interface KoinI18nProviderProps {
1097
1113
  declare const KoinI18nProvider: react__default.FC<KoinI18nProviderProps>;
1098
1114
  declare function useKoinTranslation(): KoinTranslations;
1099
1115
 
1100
- export { ALL_BUTTONS, AchievementPopup, BUTTON_GROUPS, BUTTON_LABELS, type ButtonId, CONSOLE_CAPABILITIES, CONSOLE_KEYBOARD_OVERRIDES, type Cheat, type CheatModalProps, type ConsoleCapabilities, type ControlConfig, type ControlMapperProps, type ControlMapping, type ControllerBrand, DEFAULT_CONTROLS, DEFAULT_GAMEPAD, DEFAULT_KEYBOARD, DPAD_BUTTONS, type EmulatorStatus, FACE_BUTTONS, GamePlayer, type GamePlayerProps, type GamepadInfo, type GamepadMapping, type KeyboardMapping, KoinI18nProvider, type KoinTranslations, PERFORMANCE_TIER_1_SYSTEMS, PERFORMANCE_TIER_2_SYSTEMS, type PlayerControlsProps, type PlayerIndex, type RAAchievement, type RACredentials, type RAGame, type RAGameExtended, type RAHardcodeRestrictions, RASidebar, type RAUser, RA_MEDIA_BASE, type RecursivePartial, type RetroAchievementsConfig, SHADER_PRESETS, SHOULDER_BUTTONS, STANDARD_AXIS_MAP, STANDARD_GAMEPAD_BUTTONS, STICK_BUTTONS, SUPPORTED_EXTENSIONS, SYSTEMS, SYSTEM_BUTTONS, type SaveSlot, type SaveSlotModalProps, type ShaderPresetId, ShortcutsReference, type ShowToastOptions, type SpeedMultiplier, type StandardAxis, type SystemConfig, TRIGGER_BUTTONS, type Toast, ToastContainer, type ToastType, type UseGamepadOptions, type UseGamepadReturn, type UseNostalgistReturn, type UseToastReturn, buildRetroArchConfig, clearAllControls, consoleHasButton, detectControllerBrand, detectSystem, en, es, fetchAndCacheRom, formatGamepadButton, formatKeyCode, fr, gamepadToRetroArchConfig, getAchievementBadgeUrl, getCachedRom, getConsoleButtons, getConsoleCapabilities, getConsoleKeyboardDefaults, getCore, getDBSystemNames, getFullGamepadMapping, getFullKeyboardMapping, getSupportedExtensions, getSystem, getSystemByDbName, getSystemByKey, getSystemFromExtension, getSystemsList, getUserAvatarUrl, isSystemSupported, keyboardToRetroArchConfig, loadAllGamepadMappings, loadGamepadMapping, loadKeyboardMapping, normalizeSystemKey, saveGamepadMapping, saveKeyboardMapping, systemsMatch, useGameRecording, useGamepad, useKoinTranslation, useNostalgist, useToast };
1116
+ export { ALL_BUTTONS, AchievementPopup, BUTTON_GROUPS, BUTTON_LABELS, type ButtonId, CONSOLE_CAPABILITIES, CONSOLE_KEYBOARD_OVERRIDES, type Cheat, type CheatModalProps, type CheatSource, type ConsoleCapabilities, type ControlConfig, type ControlMapperProps, type ControlMapping, type ControllerBrand, DEFAULT_CONTROLS, DEFAULT_GAMEPAD, DEFAULT_KEYBOARD, DPAD_BUTTONS, type EmulatorStatus, FACE_BUTTONS, GamePlayer, type GamePlayerProps, type GamepadInfo, type GamepadMapping, type KeyboardMapping, KoinI18nProvider, type KoinTranslations, PERFORMANCE_TIER_1_SYSTEMS, PERFORMANCE_TIER_2_SYSTEMS, type PlayerControlsProps, type PlayerIndex, type RAAchievement, type RACredentials, type RAGame, type RAGameExtended, type RAHardcodeRestrictions, RASidebar, type RAUser, RA_MEDIA_BASE, type RecursivePartial, type RetroAchievementsConfig, SHADER_PRESETS, SHOULDER_BUTTONS, STANDARD_AXIS_MAP, STANDARD_GAMEPAD_BUTTONS, STICK_BUTTONS, SUPPORTED_EXTENSIONS, SYSTEMS, SYSTEM_BUTTONS, type SaveSlot, type SaveSlotModalProps, type ShaderPresetId, ShortcutsReference, type ShowToastOptions, type SpeedMultiplier, type StandardAxis, type SystemConfig, TRIGGER_BUTTONS, type Toast, ToastContainer, type ToastType, type UseGamepadOptions, type UseGamepadReturn, type UseNostalgistReturn, type UseToastReturn, buildRetroArchConfig, clearAllControls, consoleHasButton, detectControllerBrand, detectSystem, en, es, fetchAndCacheRom, formatGamepadButton, formatKeyCode, fr, gamepadToRetroArchConfig, getAchievementBadgeUrl, getCachedRom, getConsoleButtons, getConsoleCapabilities, getConsoleKeyboardDefaults, getCore, getDBSystemNames, getFullGamepadMapping, getFullKeyboardMapping, getSupportedExtensions, getSystem, getSystemByDbName, getSystemByKey, getSystemFromExtension, getSystemsList, getUserAvatarUrl, isSystemSupported, keyboardToRetroArchConfig, loadAllGamepadMappings, loadGamepadMapping, loadKeyboardMapping, normalizeSystemKey, saveGamepadMapping, saveKeyboardMapping, systemsMatch, useGameRecording, useGamepad, useKoinTranslation, useNostalgist, useToast };
package/dist/index.d.ts CHANGED
@@ -268,6 +268,10 @@ interface UseNostalgistOptions {
268
268
  romFileName?: string;
269
269
  shader?: string;
270
270
  romId?: string;
271
+ activeCheats?: {
272
+ code: string;
273
+ desc?: string;
274
+ }[];
271
275
  }
272
276
  interface UseNostalgistReturn {
273
277
  status: EmulatorStatus;
@@ -299,12 +303,16 @@ interface UseNostalgistReturn {
299
303
  toggleMute: () => void;
300
304
  screenshot: () => Promise<string | null>;
301
305
  pressKey: (key: string) => void;
306
+ pressDown: (button: string) => void;
307
+ pressUp: (button: string) => void;
302
308
  resize: (size: {
303
309
  width: number;
304
310
  height: number;
305
311
  }) => void;
306
- applyCheat: (code: string) => void;
307
- resetCheats: () => void;
312
+ injectCheats: (cheats: {
313
+ code: string;
314
+ }[]) => void;
315
+ clearCheats: () => void;
308
316
  getNostalgistInstance: () => Nostalgist | null;
309
317
  isPerformanceMode: boolean;
310
318
  }
@@ -479,6 +487,8 @@ interface KoinTranslations {
479
487
  exit: string;
480
488
  language: string;
481
489
  selectLanguage: string;
490
+ haptics: string;
491
+ enableHaptics: string;
482
492
  };
483
493
  overlay: {
484
494
  play: string;
@@ -562,6 +572,9 @@ interface KoinTranslations {
562
572
  copy: string;
563
573
  active: string;
564
574
  toggleHint: string;
575
+ codePlaceholder: string;
576
+ descPlaceholder: string;
577
+ add: string;
565
578
  };
566
579
  saveSlots: {
567
580
  title: string;
@@ -802,14 +815,17 @@ interface ControlMapperProps {
802
815
  interface CheatModalProps {
803
816
  isOpen: boolean;
804
817
  cheats: Cheat[];
805
- activeCheats: Set<number>;
806
- onToggle: (cheatId: number) => void;
818
+ activeCheats: Set<string>;
819
+ onToggle: (cheatId: string) => void;
807
820
  onClose: () => void;
821
+ onAddManualCheat?: (code: string, description: string) => void;
808
822
  }
823
+ type CheatSource = 'database' | 'manual';
809
824
  interface Cheat {
810
- id: number;
825
+ id: string;
811
826
  code: string;
812
827
  description: string;
828
+ source?: CheatSource;
813
829
  }
814
830
  interface RAHardcodeRestrictions {
815
831
  isHardcore?: boolean;
@@ -1097,4 +1113,4 @@ interface KoinI18nProviderProps {
1097
1113
  declare const KoinI18nProvider: react__default.FC<KoinI18nProviderProps>;
1098
1114
  declare function useKoinTranslation(): KoinTranslations;
1099
1115
 
1100
- export { ALL_BUTTONS, AchievementPopup, BUTTON_GROUPS, BUTTON_LABELS, type ButtonId, CONSOLE_CAPABILITIES, CONSOLE_KEYBOARD_OVERRIDES, type Cheat, type CheatModalProps, type ConsoleCapabilities, type ControlConfig, type ControlMapperProps, type ControlMapping, type ControllerBrand, DEFAULT_CONTROLS, DEFAULT_GAMEPAD, DEFAULT_KEYBOARD, DPAD_BUTTONS, type EmulatorStatus, FACE_BUTTONS, GamePlayer, type GamePlayerProps, type GamepadInfo, type GamepadMapping, type KeyboardMapping, KoinI18nProvider, type KoinTranslations, PERFORMANCE_TIER_1_SYSTEMS, PERFORMANCE_TIER_2_SYSTEMS, type PlayerControlsProps, type PlayerIndex, type RAAchievement, type RACredentials, type RAGame, type RAGameExtended, type RAHardcodeRestrictions, RASidebar, type RAUser, RA_MEDIA_BASE, type RecursivePartial, type RetroAchievementsConfig, SHADER_PRESETS, SHOULDER_BUTTONS, STANDARD_AXIS_MAP, STANDARD_GAMEPAD_BUTTONS, STICK_BUTTONS, SUPPORTED_EXTENSIONS, SYSTEMS, SYSTEM_BUTTONS, type SaveSlot, type SaveSlotModalProps, type ShaderPresetId, ShortcutsReference, type ShowToastOptions, type SpeedMultiplier, type StandardAxis, type SystemConfig, TRIGGER_BUTTONS, type Toast, ToastContainer, type ToastType, type UseGamepadOptions, type UseGamepadReturn, type UseNostalgistReturn, type UseToastReturn, buildRetroArchConfig, clearAllControls, consoleHasButton, detectControllerBrand, detectSystem, en, es, fetchAndCacheRom, formatGamepadButton, formatKeyCode, fr, gamepadToRetroArchConfig, getAchievementBadgeUrl, getCachedRom, getConsoleButtons, getConsoleCapabilities, getConsoleKeyboardDefaults, getCore, getDBSystemNames, getFullGamepadMapping, getFullKeyboardMapping, getSupportedExtensions, getSystem, getSystemByDbName, getSystemByKey, getSystemFromExtension, getSystemsList, getUserAvatarUrl, isSystemSupported, keyboardToRetroArchConfig, loadAllGamepadMappings, loadGamepadMapping, loadKeyboardMapping, normalizeSystemKey, saveGamepadMapping, saveKeyboardMapping, systemsMatch, useGameRecording, useGamepad, useKoinTranslation, useNostalgist, useToast };
1116
+ export { ALL_BUTTONS, AchievementPopup, BUTTON_GROUPS, BUTTON_LABELS, type ButtonId, CONSOLE_CAPABILITIES, CONSOLE_KEYBOARD_OVERRIDES, type Cheat, type CheatModalProps, type CheatSource, type ConsoleCapabilities, type ControlConfig, type ControlMapperProps, type ControlMapping, type ControllerBrand, DEFAULT_CONTROLS, DEFAULT_GAMEPAD, DEFAULT_KEYBOARD, DPAD_BUTTONS, type EmulatorStatus, FACE_BUTTONS, GamePlayer, type GamePlayerProps, type GamepadInfo, type GamepadMapping, type KeyboardMapping, KoinI18nProvider, type KoinTranslations, PERFORMANCE_TIER_1_SYSTEMS, PERFORMANCE_TIER_2_SYSTEMS, type PlayerControlsProps, type PlayerIndex, type RAAchievement, type RACredentials, type RAGame, type RAGameExtended, type RAHardcodeRestrictions, RASidebar, type RAUser, RA_MEDIA_BASE, type RecursivePartial, type RetroAchievementsConfig, SHADER_PRESETS, SHOULDER_BUTTONS, STANDARD_AXIS_MAP, STANDARD_GAMEPAD_BUTTONS, STICK_BUTTONS, SUPPORTED_EXTENSIONS, SYSTEMS, SYSTEM_BUTTONS, type SaveSlot, type SaveSlotModalProps, type ShaderPresetId, ShortcutsReference, type ShowToastOptions, type SpeedMultiplier, type StandardAxis, type SystemConfig, TRIGGER_BUTTONS, type Toast, ToastContainer, type ToastType, type UseGamepadOptions, type UseGamepadReturn, type UseNostalgistReturn, type UseToastReturn, buildRetroArchConfig, clearAllControls, consoleHasButton, detectControllerBrand, detectSystem, en, es, fetchAndCacheRom, formatGamepadButton, formatKeyCode, fr, gamepadToRetroArchConfig, getAchievementBadgeUrl, getCachedRom, getConsoleButtons, getConsoleCapabilities, getConsoleKeyboardDefaults, getCore, getDBSystemNames, getFullGamepadMapping, getFullKeyboardMapping, getSupportedExtensions, getSystem, getSystemByDbName, getSystemByKey, getSystemFromExtension, getSystemsList, getUserAvatarUrl, isSystemSupported, keyboardToRetroArchConfig, loadAllGamepadMappings, loadGamepadMapping, loadKeyboardMapping, normalizeSystemKey, saveGamepadMapping, saveKeyboardMapping, systemsMatch, useGameRecording, useGamepad, useKoinTranslation, useNostalgist, useToast };