js-dos 7.2.1 → 7.2.6

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.
Files changed (52) hide show
  1. package/.github/workflows/codeql-analysis.yml +70 -0
  2. package/README.md +2 -2
  3. package/dist/emulators-ui-loader.png +0 -0
  4. package/dist/js-dos.css +199 -8
  5. package/dist/js-dos.js +16 -1
  6. package/dist/js-dos.js.map +1 -1
  7. package/dist/types/src/backend/jj/jj-config.d.ts +6 -0
  8. package/dist/types/src/backend/jj/latency.d.ts +8 -0
  9. package/dist/types/src/{personal.d.ts → backend/v7/personal.d.ts} +0 -0
  10. package/dist/types/src/backend/v7/v7-config.d.ts +8 -0
  11. package/dist/types/src/components/region.d.ts +6 -0
  12. package/dist/types/src/components/sidebar/active-token.d.ts +2 -0
  13. package/dist/types/src/components/sidebar/create-token.d.ts +2 -0
  14. package/dist/types/src/components/sidebar/latency-info.d.ts +7 -0
  15. package/dist/types/src/components/sidebar/main.d.ts +2 -0
  16. package/dist/types/src/components/sidebar/networking.d.ts +2 -0
  17. package/dist/types/src/components/tip.d.ts +2 -0
  18. package/dist/types/src/hardware-transport-layer.d.ts +4 -2
  19. package/dist/types/src/icons.d.ts +30 -0
  20. package/dist/types/src/player-app.d.ts +22 -2
  21. package/dist/types/src/player.d.ts +2 -0
  22. package/dist/types/src/xhr.d.ts +1 -0
  23. package/dist/types/{sls → v7-services}/src/personal.d.ts +0 -0
  24. package/dist/wdosbox.js +1 -1
  25. package/dist/wdosbox.js.symbols +3132 -3071
  26. package/dist/wdosbox.wasm +0 -0
  27. package/examples/digger/index.html +5 -1
  28. package/package.json +7 -4
  29. package/v7-services/.env +6 -0
  30. package/v7-services/ok.yaml +24 -0
  31. package/v7-services/package.json +17 -0
  32. package/v7-services/redeploy-ok.sh +25 -0
  33. package/v7-services/serverless.yml +140 -0
  34. package/v7-services/src/networking/day.ts +5 -0
  35. package/v7-services/src/networking/get-free-token.ts +33 -0
  36. package/v7-services/src/networking/get-token-cost.ts +31 -0
  37. package/v7-services/src/networking/get-token-info.ts +16 -0
  38. package/v7-services/src/networking/ipx/put-ipx-ip.ts +20 -0
  39. package/v7-services/src/networking/ipx/start-ipx.ts +16 -0
  40. package/v7-services/src/networking/ipx/stop-ipx.ts +19 -0
  41. package/v7-services/src/networking/limits.ts +3 -0
  42. package/v7-services/src/networking/token.ts +238 -0
  43. package/v7-services/src/ok.ts +7 -0
  44. package/v7-services/src/personal-acl.ts +33 -0
  45. package/v7-services/src/personal-put.ts +35 -0
  46. package/v7-services/src/personal.ts +18 -0
  47. package/v7-services/src/responses.ts +28 -0
  48. package/v7-services/src/user.ts +3 -0
  49. package/v7-services/yarn.lock +4400 -0
  50. package/yarn-error.log +9 -9
  51. package/dist/emulators-ui-loader.gif +0 -0
  52. package/examples/digger/bundle.jsdos +0 -0
@@ -0,0 +1,6 @@
1
+ export interface AwsRegion {
2
+ label: string;
3
+ name: string;
4
+ ok: string;
5
+ }
6
+ export declare const awsRegions: AwsRegion[];
@@ -0,0 +1,8 @@
1
+ export interface LatencyInfo {
2
+ region: string;
3
+ regionLatency: number;
4
+ estimation: {
5
+ [region: string]: number[];
6
+ };
7
+ }
8
+ export declare function getAutoRegion(onLatencyUpdate: (region: string) => void): Promise<LatencyInfo>;
@@ -0,0 +1,8 @@
1
+ export declare const endpointBase = "https://kdhkdsv558.execute-api.eu-central-1.amazonaws.com/dev";
2
+ export declare const personalPut: string;
3
+ export declare const personalAcl: string;
4
+ export declare const tokenCostGet: string;
5
+ export declare const freeTokenGet: string;
6
+ export declare const tokeInfoGet: string;
7
+ export declare const startIpx: string;
8
+ export declare const stopIox: string;
@@ -0,0 +1,6 @@
1
+ import { Props } from "../player-app";
2
+ interface RegionProps extends Props {
3
+ class?: string;
4
+ }
5
+ export declare function Region(props: RegionProps): import("preact").VNode<any> | import("preact").VNode<any>[];
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Props } from "../../player-app";
2
+ export declare function ActiveToken(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -0,0 +1,2 @@
1
+ import { Props } from "../../player-app";
2
+ export declare function CreateToken(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -0,0 +1,7 @@
1
+ import { Props } from "../../player-app";
2
+ interface LatencyInfoProps extends Props {
3
+ class?: string;
4
+ asButton?: boolean;
5
+ }
6
+ export declare function LatencyInfo(props: LatencyInfoProps): import("preact").VNode<any> | import("preact").VNode<any>[];
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Props } from "../../player-app";
2
+ export declare function Main(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -0,0 +1,2 @@
1
+ import { Props } from "../../player-app";
2
+ export declare function Networking(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -0,0 +1,2 @@
1
+ import { Props } from "../player-app";
2
+ export declare function Tips(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -3,10 +3,12 @@ export interface Hardware {
3
3
  readConfig(): string;
4
4
  sendMessage(payload: string): void;
5
5
  addKey(key: number, pressed: number, timeMs: number): void;
6
- mouseMove(x: number, y: number, timeMs: number): void;
6
+ mouseMove(x: number, y: number, relative: boolean, timeMs: number): void;
7
7
  mouseButton(button: number, pressed: number, timeMs: number): void;
8
8
  getFramePayload(): string;
9
- writeFile(path: string, blob: string): string;
9
+ createFile(path: string): string;
10
+ appendFile(blob: string): string;
11
+ closeFile(): string;
10
12
  }
11
13
  export declare class HardwareTransportLayerFactory {
12
14
  private serverMessageHandler;
@@ -32,6 +32,12 @@ export declare const Icons: {
32
32
  ArrowsExpand: (props: {
33
33
  class: string;
34
34
  }) => import("preact").VNode<any> | import("preact").VNode<any>[];
35
+ ArrowsCircleLeft: (props: {
36
+ class: string;
37
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
38
+ ArrowsCircleRight: (props: {
39
+ class: string;
40
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
35
41
  ChevronLeft: (props: {
36
42
  class: string;
37
43
  }) => import("preact").VNode<any> | import("preact").VNode<any>[];
@@ -50,4 +56,28 @@ export declare const Icons: {
50
56
  Plus: (props: {
51
57
  class: string;
52
58
  }) => import("preact").VNode<any> | import("preact").VNode<any>[];
59
+ CursorClick: (props: {
60
+ class: string;
61
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
62
+ Cursor: (props: {
63
+ class: string;
64
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
65
+ Refresh: (props: {
66
+ class: string;
67
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
68
+ CurrencyDollar: (props: {
69
+ class: string;
70
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
71
+ QuestionMarkCircle: (props: {
72
+ class: string;
73
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
74
+ Discord: (props: {
75
+ class: string;
76
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
77
+ Telegram: (props: {
78
+ class: string;
79
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
80
+ Twitter: (props: {
81
+ class: string;
82
+ }) => import("preact").VNode<any> | import("preact").VNode<any>[];
53
83
  };
@@ -1,15 +1,21 @@
1
- import "preact/debug";
2
1
  import { ClientId, DosPlayer, DosPlayerOptions } from "./player";
2
+ import { LatencyInfo } from "./backend/jj/latency";
3
+ export declare type SidebarPage = "main" | "latency-info" | "networking";
3
4
  export interface Props {
4
5
  player: () => DosPlayer;
5
6
  options: () => DosPlayerOptions;
6
7
  clientId: ClientId | null;
7
8
  setClientId: (clientId: ClientId | null) => void;
8
9
  requestClientId?: (userGesture: boolean) => Promise<ClientId | null>;
10
+ anonymousClientId: ClientId;
11
+ networkToken: string | null;
12
+ setNetworkToken: (token: string | null) => void;
9
13
  mobileControls: boolean;
10
14
  setMobileControls: (controls: boolean) => Promise<void>;
11
15
  mirroredControls: boolean;
12
16
  setMirroredControls: (mirrored: boolean) => Promise<void>;
17
+ autolock: boolean;
18
+ setAutolock: (autolock: boolean) => Promise<void>;
13
19
  keyboard: boolean;
14
20
  toggleKeyboard: () => void;
15
21
  fullscreen: boolean;
@@ -23,9 +29,23 @@ export interface Props {
23
29
  sideBar: boolean;
24
30
  openSideBar: () => void;
25
31
  closeSideBar: () => void;
32
+ region: string | null;
33
+ estimatingRegion: string | null;
34
+ setRegion: (region: string | null) => void;
35
+ latencyInfo: LatencyInfo | null;
36
+ setLatencyInfo: (latencyInfo: LatencyInfo) => void;
37
+ showTips: boolean;
38
+ setShowTips: (showTips: boolean) => void;
39
+ sideBarPage: SidebarPage;
40
+ setSideBarPage: (page: SidebarPage) => void;
41
+ showNewInstance: boolean;
42
+ setShowNewInstance: (showNewInstance: boolean) => void;
43
+ ipxConnected: boolean;
44
+ setIpxConnected: (ipxConnected: boolean) => void;
26
45
  }
27
46
  export declare function PlayerApp(playerProps: {
28
47
  player: () => DosPlayer;
29
48
  options: () => DosPlayerOptions;
49
+ setOnRun: (onRun: () => void) => void;
30
50
  }): import("preact").VNode<any> | import("preact").VNode<any>[];
31
- export declare function createPlayerApp(root: HTMLDivElement, player: DosPlayer, options: DosPlayerOptions): void;
51
+ export declare function createPlayerApp(root: HTMLDivElement, player: DosPlayer, options: DosPlayerOptions, setOnRun: (onRun: () => void) => void): void;
@@ -15,6 +15,8 @@ export interface DosPlayerOptions extends DosOptions {
15
15
  onExit?: () => void;
16
16
  noSideBar?: boolean;
17
17
  noFullscreen?: boolean;
18
+ noSocialLinks?: boolean;
19
+ withExperimentalApi?: boolean;
18
20
  }
19
21
  export declare type DosPlayerFactoryType = (root: HTMLDivElement, options?: DosPlayerOptions) => DosPlayer;
20
22
  export declare function DosPlayer(root: HTMLDivElement, options?: DosPlayerOptions): DosPlayer;
@@ -2,4 +2,5 @@ export declare function send(method: "get" | "post" | "head" | "put", url: strin
2
2
  [name: string]: string;
3
3
  }): Promise<string | ArrayBuffer>;
4
4
  export declare function postObject(url: string, data?: string | ArrayBuffer): Promise<any>;
5
+ export declare function getObject(url: string): Promise<any>;
5
6
  export declare function post(url: string, responseType: XMLHttpRequestResponseType, data?: string | ArrayBuffer): Promise<string | ArrayBuffer>;