visualcopium 1.0.5 → 1.0.7
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.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/dom.d.ts +0 -40
- package/dist/index.d.ts +0 -60
- package/dist/typing.d.ts +0 -27
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3B,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,CAAA;QACjD,YAAY,EAAE,OAAO,CAAA;KACrB;CACD;AAID;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAU5E;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAElD;AAID;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGnE;AAID;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3B,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,CAAA;QACjD,YAAY,EAAE,OAAO,CAAA;KACrB;CACD;AAID;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAU5E;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAElD;AAID;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGnE;AAID;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB3C;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE5C"}
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export function RepeatUntil(condition, callback) {
|
|
|
27
27
|
* @param callback Code block/function
|
|
28
28
|
*/
|
|
29
29
|
export function RepeatWhile(condition, callback) {
|
|
30
|
-
while (
|
|
30
|
+
while ((() => typeof condition == "number"
|
|
31
31
|
? condition != 0
|
|
32
32
|
: typeof condition == "boolean"
|
|
33
33
|
? condition
|
|
@@ -60,7 +60,21 @@ export function PickRandom(minimum, maximum) {
|
|
|
60
60
|
* @returns User's response
|
|
61
61
|
*/
|
|
62
62
|
export function Ask(message) {
|
|
63
|
-
|
|
63
|
+
if ((typeof window != "undefined" || typeof Bun != "undefined") &&
|
|
64
|
+
typeof window.prompt == "function")
|
|
65
|
+
return prompt(message, "");
|
|
66
|
+
if (typeof process !== "undefined") {
|
|
67
|
+
process.stdout.write(message);
|
|
68
|
+
try {
|
|
69
|
+
const buffer = Buffer.alloc(4096);
|
|
70
|
+
const bytesRead = require("fs").readSync(0, buffer, 0, 4096, null);
|
|
71
|
+
return buffer.toString("utf8", 0, bytesRead).replace(/\r?\n$/, "");
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return "";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return "";
|
|
64
78
|
}
|
|
65
79
|
/**
|
|
66
80
|
* Says a message.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,UAAU;AAEV;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,QAAoB;IACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAA;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,SAAoB,EAAE,QAAoB;IACrE,OACC,CAAC,CAAC,GAAG,EAAE,CACN,OAAO,SAAS,IAAI,QAAQ;QAC3B,CAAC,CAAC,SAAS,IAAI,CAAC;QACh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MAAM,UAAU,UAAU,CAAC,OAAe;IACzC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACrC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visualcopium",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"author": {
|
|
5
5
|
"url": "https://github.com/boyninja1555",
|
|
6
6
|
"email": "flappyfloorg@gmail.com",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"prepublish": "npm run build"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@types/bun": "^1.4.2",
|
|
45
46
|
"@types/node": "^26.5.1",
|
|
46
47
|
"typescript": "^7.0.2"
|
|
47
48
|
}
|
package/dist/dom.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Vec2n } from "./typing.js";
|
|
2
|
-
export type BrowserKey = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "Space" | "Enter" | "Backspace" | "Tab" | "Escape" | "Shift" | "Ctrl" | "Alt" | "Up Arrow" | "Down Arrow" | "Left Arrow" | "Right Arrow" | "Caps Lock" | "Delete" | "Home" | "End" | "Page Up" | "Page Down" | "Insert" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | "`" | "-" | "=" | "[" | "]" | "\\" | ";" | "'" | "," | "." | "/";
|
|
3
|
-
/**
|
|
4
|
-
* Code will run once the page finishes loading.
|
|
5
|
-
* @param callback Code block/function
|
|
6
|
-
*/
|
|
7
|
-
export declare function WhenFlagClicked(callback: () => void): void;
|
|
8
|
-
/**
|
|
9
|
-
* Code will run when a specific key is pressed.
|
|
10
|
-
* @param key Key to look for
|
|
11
|
-
* @param callback Code block/function
|
|
12
|
-
*/
|
|
13
|
-
export declare function WhenKeyPressed(key: BrowserKey, callback: () => void): void;
|
|
14
|
-
/**
|
|
15
|
-
* Returns whether a specific key is pressed.
|
|
16
|
-
* @param key Key to look for
|
|
17
|
-
* @returns Whether a specific key is pressed
|
|
18
|
-
*/
|
|
19
|
-
export declare function KeyPressed(key: BrowserKey): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Returns whether the mouse is pressed down.
|
|
22
|
-
* @returns Whether the mouse is pressed down
|
|
23
|
-
*/
|
|
24
|
-
export declare function MouseDown(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Returns the mouse's position as a vector object. Use `MouseX();` and `MouseY();` for simplified return values!
|
|
27
|
-
* @returns Mouse's position (Vec2n)
|
|
28
|
-
*/
|
|
29
|
-
export declare function MousePosition(): Vec2n;
|
|
30
|
-
/**
|
|
31
|
-
* Return's the mouse's X position.
|
|
32
|
-
* @returns Mouse's X position
|
|
33
|
-
*/
|
|
34
|
-
export declare function MouseX(): number;
|
|
35
|
-
/**
|
|
36
|
-
* Return's the mouse's Y position.
|
|
37
|
-
* @returns Mouse's Y position
|
|
38
|
-
*/
|
|
39
|
-
export declare function MouseY(): number;
|
|
40
|
-
//# sourceMappingURL=dom.d.ts.map
|
package/dist/index.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Condition } from "./typing.js";
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
VC_pressedKeys: Set<String>;
|
|
5
|
-
VC_keyPressListeners: Map<string, (() => void)[]>;
|
|
6
|
-
VC_mouseDown: boolean;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Repeats the code block/function a number of times.
|
|
11
|
-
* @param times Number of times to repeat
|
|
12
|
-
* @param callback Code block/function
|
|
13
|
-
*/
|
|
14
|
-
export declare function Repeat(times: number, callback: () => void): void;
|
|
15
|
-
/**
|
|
16
|
-
* Repeats the code block/function until a condition is finally true.
|
|
17
|
-
* @param condition Either a code block/function that returns a boolean or an expression that evaluates to one.
|
|
18
|
-
* @param callback Code block/function
|
|
19
|
-
*/
|
|
20
|
-
export declare function RepeatUntil(condition: Condition, callback: () => void): void;
|
|
21
|
-
/**
|
|
22
|
-
* Repeats the code block/function until a condition is no longer true.
|
|
23
|
-
* @param condition Either a code block/function that returns a boolean or an expression that evaluates to one.
|
|
24
|
-
* @param callback Code block/function
|
|
25
|
-
*/
|
|
26
|
-
export declare function RepeatWhile(condition: Condition, callback: () => void): void;
|
|
27
|
-
/**
|
|
28
|
-
* Repeats the code block/function forever. Use sparingly! Not recommended for browser use, will lag crazily. This is something we cannot fix.
|
|
29
|
-
* @param callback Code block/function
|
|
30
|
-
*/
|
|
31
|
-
export declare function Forever(callback: () => void): void;
|
|
32
|
-
/**
|
|
33
|
-
* Picks random integer between a minimum and maximum (inclusive)
|
|
34
|
-
* @param minimum Minimum integer
|
|
35
|
-
* @param maximum Maximum integer
|
|
36
|
-
* @returns Random integer
|
|
37
|
-
*/
|
|
38
|
-
export declare function PickRandom(minimum: number, maximum: number): number;
|
|
39
|
-
/**
|
|
40
|
-
* Asks the user a question and waits for a response.
|
|
41
|
-
* @param message Question/message to ask
|
|
42
|
-
* @returns User's response
|
|
43
|
-
*/
|
|
44
|
-
export declare function Ask(message: string): string;
|
|
45
|
-
/**
|
|
46
|
-
* Says a message.
|
|
47
|
-
* @param message Message to say
|
|
48
|
-
*/
|
|
49
|
-
export declare function Say(message: string): void;
|
|
50
|
-
/**
|
|
51
|
-
* Says a message in the form of a warning.
|
|
52
|
-
* @param warning Warning message to say
|
|
53
|
-
*/
|
|
54
|
-
export declare function SayWarning(warning: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Says a message in the form of an error.
|
|
57
|
-
* @param error Error message to say
|
|
58
|
-
*/
|
|
59
|
-
export declare function SayError(error: string): void;
|
|
60
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/typing.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines either a code block/function that returns a boolean or an expression that evaluates to one.
|
|
3
|
-
*/
|
|
4
|
-
export type Condition = (() => boolean) | boolean | 0 | 1;
|
|
5
|
-
/**
|
|
6
|
-
* Defines a generic object type which can store two values of the same type. Look into `Vec2n` for the strictly numerical variant!
|
|
7
|
-
*/
|
|
8
|
-
export type Vec2<T> = {
|
|
9
|
-
x: T;
|
|
10
|
-
y: T;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Defines an object type containing two numbers.
|
|
14
|
-
*/
|
|
15
|
-
export type Vec2n = Vec2<number>;
|
|
16
|
-
/**
|
|
17
|
-
* Defines a generic object type which can store three values of the same type. Look into `Vec3n` for the strictly numerical variant!
|
|
18
|
-
*/
|
|
19
|
-
export type Vec3<T> = {
|
|
20
|
-
x: T;
|
|
21
|
-
y: T;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Defines an object type containing three numbers.
|
|
25
|
-
*/
|
|
26
|
-
export type Vec3n = Vec2<number>;
|
|
27
|
-
//# sourceMappingURL=typing.d.ts.map
|