Updated script that can be controled by Nodejs web app

This commit is contained in:
mac OS
2024-11-25 12:24:18 +07:00
parent c440eda1f4
commit 8b0ab2bd3a
8662 changed files with 1803808 additions and 34 deletions

7
node_modules/eventlet/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
# eventlet
## 0.1.0
### Minor Changes
- 5d0823c: Initial release

55
node_modules/eventlet/README.md generated vendored Normal file
View File

@ -0,0 +1,55 @@
# Eventlet
Eventlet is a minimal typed event library.
It is designed to be used as either a standalone object which emits events, or as a member property of a class that emits events. You can create an Eventlet and specify the listener signature like this:
```ts
const greeter = new Eventlet<(greeting: string, subject: string) => void>();
const onGreet = (greeting: string, subject: string) => console.log(`${ greeting }, ${ subject }!`);
greeter.add(onGreet);
greeter.emit("Hello", "world"); // "Hello, world!"
```
The ability to emit is typed separately from the ability to register listeners (`EmitControl` vs. `Emitter`, respectively), making it easy to hide emit capabilities from your public interfaces:
```ts
class ClassWithChangingProperty {
private _prop = 3;
public get prop() {
return this._prop;
}
public set prop(newValue: number) {
this._prop = newValue;
this._propChanged.emit();
}
// The default listener signature has no parameters if event typing is not provided.
private readonly _propChanged = new Eventlet();
// The public interface can just expose the Emitter capability of the Eventlet.
// This keeps its EmitControl capability private.
public get propChanged(): Emitter {
return this._propChanged;
}
}
```
If you don't specify a listener signature, it defaults to `() => void`.
Listeners can be removed when they are no longer needed. Pass the same function reference that was originally added.
```ts
type MessageReceivedListener = (message: string) => void;
const messageReceived = new Eventlet<MessageReceivedListener>();
const onMessageReceived = (message: string) => console.log(message);
messageReceived.add(onMessageReceived);
messageReceived.emit("Hello!"); // "Hello!"
// ...time passes...
messageReceived.remove(onMessageReceived);
```
## Usage recommendations
* Each Eventlet is designed to be used for a single event type. For a scenario with multiple event types, use multiple Eventlets.
* Eventlet should not be used as a superclass. Instead add an Eventlet as a member property of the class that will use it.
* References to the registered listeners are held by the Eventlet. Be sure to remove them when they're no longer needed so they can be garbage collected appropriately.

24
node_modules/eventlet/UNLICENSE generated vendored Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

13
node_modules/eventlet/built/eventlet.d.ts generated vendored Normal file
View File

@ -0,0 +1,13 @@
import type { EmitControl, Emitter, UntypedListener } from "./types.js";
/**
* Eventlet supports a minimal typed event pattern. It is designed to be used as either a standalone object
* which emits events, or as a member property of a class that emits events. It should not be used as a superclass
* for a class which will emit events.
*/
export declare class Eventlet<Listener extends UntypedListener = () => void> implements EmitControl<Listener>, Emitter<Listener> {
private readonly listeners;
readonly emit: (...args: Parameters<Listener>) => void;
readonly add: (listener: Listener) => void;
readonly remove: (listener: Listener) => void;
}
//# sourceMappingURL=eventlet.d.ts.map

21
node_modules/eventlet/built/eventlet.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
/**
* Eventlet supports a minimal typed event pattern. It is designed to be used as either a standalone object
* which emits events, or as a member property of a class that emits events. It should not be used as a superclass
* for a class which will emit events.
*/
export class Eventlet {
listeners = new Set();
emit = (...args) => {
// Set is specified to iterate in insertion order
for (const listener of this.listeners) {
listener(...args);
}
};
add = (listener) => {
this.listeners.add(listener);
};
remove = (listener) => {
this.listeners.delete(listener);
};
}
//# sourceMappingURL=eventlet.js.map

3
node_modules/eventlet/built/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,3 @@
export { Eventlet } from "./eventlet.js";
export type { EmitControl, Emitter, UntypedListener, } from "./types.js";
//# sourceMappingURL=index.d.ts.map

2
node_modules/eventlet/built/index.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
export { Eventlet } from "./eventlet.js";
//# sourceMappingURL=index.js.map

26
node_modules/eventlet/built/types.d.ts generated vendored Normal file
View File

@ -0,0 +1,26 @@
/**
* The untyped listener is the least-constrained listener type Eventlet will accept (any void function).
* Prefer to define a strict listener type.
*/
export type UntypedListener = (...args: any[]) => void;
/**
* An EmitControl permits emitting, which will trigger any registered listener functions.
*/
export type EmitControl<Listener extends UntypedListener = () => void> = {
readonly emit: (...args: Parameters<Listener>) => void;
};
/**
* Listener functions can be registered with an Emitter, which will then be called when it emits.
*/
export type Emitter<Listener extends UntypedListener = () => void> = {
/**
* Add a listener that will be called when the Emitter emits.
*/
readonly add: (listener: Listener) => void;
/**
* Remove a listener from the set that will be called when the Emitter emits. The listener must
* be the same object reference that was used to register previously.
*/
readonly remove: (listener: Listener) => void;
};
//# sourceMappingURL=types.d.ts.map

2
node_modules/eventlet/built/types.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

39
node_modules/eventlet/package.json generated vendored Normal file
View File

@ -0,0 +1,39 @@
{
"name": "eventlet",
"version": "0.1.0",
"description": "A minimal typed event library",
"main": "built/index.js",
"types": "built/index.d.ts",
"sideEffects": false,
"keywords": [
"eventlet",
"events",
"emitters",
"listeners"
],
"author": "Matt Rakow",
"license": "Unlicense",
"type": "module",
"devDependencies": {
"@jest/globals": "^29.7.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"typescript": "^5.4.5",
"eslint-config-shared": "0.0.0",
"tsconfig-shared": "0.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ChumpChief/eventlet.git",
"directory": "packages/eventlet"
},
"homepage": "https://github.com/ChumpChief/eventlet#readme",
"scripts": {
"build": "tsc",
"clean": "rm -rf built",
"lint": "eslint src",
"test": "NODE_OPTIONS=--experimental-vm-modules jest built/.*.test.js"
}
}