narraleaf-react 0.1.0 → 0.1.2

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.
@@ -36,8 +36,8 @@ export type GameConfig = {
36
36
  * The minimum width and height of the player in pixels
37
37
  */
38
38
  minHeight: number;
39
- width: number | string;
40
- height: number | string;
39
+ width: number;
40
+ height: number;
41
41
  /**
42
42
  * When player presses one of these keys, the game will skip the current action
43
43
  *
@@ -0,0 +1,5 @@
1
+ import React, { ErrorInfo } from "react";
2
+ export default function ErrorFallback({ error, errorInfo }: {
3
+ error: Error;
4
+ errorInfo: ErrorInfo;
5
+ }): React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ import React, { ErrorInfo, ReactNode } from "react";
2
+ import PropTypes from "prop-types";
3
+ interface ErrorBoundaryProps {
4
+ children: ReactNode;
5
+ }
6
+ interface ErrorBoundaryState {
7
+ hasError: boolean;
8
+ error: Error | null;
9
+ errorInfo: ErrorInfo | null;
10
+ }
11
+ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
12
+ static propTypes: {
13
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
14
+ };
15
+ static getDerivedStateFromError(error: Error): {
16
+ hasError: boolean;
17
+ error: Error;
18
+ errorInfo: null;
19
+ };
20
+ state: {
21
+ hasError: boolean;
22
+ error: null;
23
+ errorInfo: null;
24
+ };
25
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
26
+ render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
27
+ }
28
+ export {};
@@ -6,6 +6,7 @@ export type AspectRatioState = {
6
6
  minWidth: number;
7
7
  minHeight: number;
8
8
  paused: boolean;
9
+ scale: number;
9
10
  };
10
11
  type AspectRatioEvents = {
11
12
  "event:aspectRatio.update": [width: number, height: number];
@@ -23,7 +24,7 @@ declare class AspectRatio {
23
24
  private lockers;
24
25
  private updater;
25
26
  constructor();
26
- update(width: number, height: number): void;
27
+ update(width: number, height: number, scale: number): void;
27
28
  updateMin(width: number, height: number): void;
28
29
  lock(): symbol;
29
30
  unlock(locker: symbol | null | undefined): null;