ahegao 1.69.1

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.
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ ////////////////////////////////////////////////////////////////////////////////////
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ var _a;
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CircularArray = exports.RangedNumber = exports.Cell = exports.Grid = exports.Pos = exports.Lazy = exports.FileInfo = exports.Direction = void 0;
9
+ const fs_1 = require("fs");
10
+ const path_1 = require("path");
11
+ const util_1 = require("../utils/util");
12
+ const chalk_1 = __importDefault(require("chalk"));
13
+ var Direction;
14
+ (function (Direction) {
15
+ Direction[Direction["UP"] = 0] = "UP";
16
+ Direction[Direction["RIGHT"] = 1] = "RIGHT";
17
+ Direction[Direction["DOWN"] = 2] = "DOWN";
18
+ Direction[Direction["LEFT"] = 3] = "LEFT";
19
+ })(Direction || (exports.Direction = Direction = {}));
20
+ ////////////////////////////////////////////////////////////////////////////////////
21
+ class FileInfo {
22
+ constructor(path) {
23
+ this.path = path;
24
+ this.directory = (0, path_1.dirname)(path);
25
+ this.fullName = (0, path_1.basename)(path);
26
+ this.extension = (0, util_1.toExtension)(this.fullName);
27
+ this.hasExtension = this.extension.length > 0;
28
+ this.name = (0, util_1.removeExtension)(this.fullName);
29
+ this._stats = new Lazy(() => (0, fs_1.statSync)(this.path));
30
+ }
31
+ get stats() {
32
+ return this._stats.get();
33
+ }
34
+ isFile() {
35
+ return this.stats.isFile();
36
+ }
37
+ isDirectory() {
38
+ return this.stats.isDirectory();
39
+ }
40
+ isSymbolicLink() {
41
+ return this.stats.isSymbolicLink();
42
+ }
43
+ }
44
+ exports.FileInfo = FileInfo;
45
+ function test(getter) {
46
+ return getter();
47
+ }
48
+ class Lazy {
49
+ constructor(getter) {
50
+ this.getter = getter;
51
+ }
52
+ get() {
53
+ if (this.item == null) {
54
+ try {
55
+ this.item = this.getter();
56
+ }
57
+ catch (e) {
58
+ console.log(chalk_1.default.redBright(`Error: Lazy initialization failed!`));
59
+ throw e;
60
+ }
61
+ }
62
+ return this.item;
63
+ }
64
+ }
65
+ exports.Lazy = Lazy;
66
+ class Pos {
67
+ constructor(x = 0, y = 0) {
68
+ this.x = x;
69
+ this.y = y;
70
+ }
71
+ offset(direction, distance = 1) {
72
+ switch (direction) {
73
+ case Direction.UP: return new Pos(this.x, this.y + distance);
74
+ case Direction.RIGHT: return new Pos(this.x + distance, this.y);
75
+ case Direction.DOWN: return new Pos(this.x, this.y - distance);
76
+ case Direction.LEFT: return new Pos(this.x - distance, this.y);
77
+ }
78
+ }
79
+ up(distance) {
80
+ return this.offset(Direction.UP, distance);
81
+ }
82
+ right(distance) {
83
+ return this.offset(Direction.RIGHT, distance);
84
+ }
85
+ down(distance) {
86
+ return this.offset(Direction.DOWN, distance);
87
+ }
88
+ left(distance) {
89
+ return this.offset(Direction.LEFT, distance);
90
+ }
91
+ static pos(x, y) {
92
+ return new Pos(x, y);
93
+ }
94
+ }
95
+ exports.Pos = Pos;
96
+ class Grid {
97
+ constructor(width, height, defaultSupplier) {
98
+ this.width = width;
99
+ this.height = height;
100
+ this.cells = new Map;
101
+ this.width = width;
102
+ this.height = height;
103
+ for (let y = 0; y < this.height; ++y) {
104
+ this.cells.set(y, new Map);
105
+ for (let x = 0; x < this.width; ++x) {
106
+ const width = this.cells.get(y);
107
+ width.set(x, defaultSupplier.apply(null));
108
+ }
109
+ }
110
+ }
111
+ getItem(x, y) {
112
+ const rows = this.cells.get(y);
113
+ return rows.get(x);
114
+ }
115
+ setItem(x, y, item) {
116
+ this.cells.get(y).set(x, item);
117
+ }
118
+ }
119
+ exports.Grid = Grid;
120
+ class Cell {
121
+ constructor(up, right, down, left) {
122
+ this.walls = new Map;
123
+ this.walls.set(Direction.UP, up);
124
+ this.walls.set(Direction.RIGHT, right);
125
+ this.walls.set(Direction.DOWN, down);
126
+ this.walls.set(Direction.LEFT, left);
127
+ }
128
+ static newEmpty() {
129
+ return new Cell(false, false, false, false);
130
+ }
131
+ static newClosed() {
132
+ return new Cell(true, true, true, true);
133
+ }
134
+ getSide(direction) {
135
+ return this.walls.has(direction) ? this.walls.get(direction) : false;
136
+ }
137
+ setSide(direction, open) {
138
+ this.walls.set(direction, open);
139
+ }
140
+ }
141
+ exports.Cell = Cell;
142
+ class RangedNumber {
143
+ constructor(minValue, maxValue) {
144
+ this.minValue = minValue;
145
+ this.maxValue = maxValue;
146
+ }
147
+ static arrayLimits(array) {
148
+ return this.range(0, array.length - 1);
149
+ }
150
+ static range(minValue, maxValue) {
151
+ return new _a(minValue, maxValue);
152
+ }
153
+ static value(value) {
154
+ return new _a(value, value);
155
+ }
156
+ get() {
157
+ return (0, util_1.random)(this.minValue, this.maxValue);
158
+ }
159
+ isWithin(value) {
160
+ return this.minValue <= value && value <= this.maxValue;
161
+ }
162
+ }
163
+ exports.RangedNumber = RangedNumber;
164
+ _a = RangedNumber;
165
+ RangedNumber.ONE = _a.value(1);
166
+ RangedNumber.ZERO = _a.value(0);
167
+ RangedNumber.MINUS_ONE = _a.value(-1);
168
+ RangedNumber.ZERO_TO_ONE = _a.range(0, 1);
169
+ RangedNumber.MINUS_ONE_TO_ONE = _a.range(-1, 1);
170
+ ////////////////////////////////////////////////////////////////////////////////////
171
+ class CircularArray extends Array {
172
+ constructor(maxSize) {
173
+ super(maxSize);
174
+ this.arr = [];
175
+ }
176
+ push(...items) {
177
+ for (const item of items) {
178
+ if (this.arr.length >= this.length) {
179
+ this.arr.shift(); // remove the oldest element
180
+ }
181
+ return this.arr.push(item); // add the new element
182
+ }
183
+ return this.length;
184
+ }
185
+ }
186
+ exports.CircularArray = CircularArray;
187
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../src/structures/structs.ts"],"names":[],"mappings":";AAAA,oFAAoF;;;;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C,CAAC,AAAjB,CAAiB;AAC1B,wBAAW,GAAG,EAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,AAAnB,CAAmB;AAC9B,6BAAgB,GAAG,EAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,AAApB,CAAoB;AAiCtD,oFAAoF;AAEpF,MAAa,aAAiB,SAAQ,KAAQ;IAI1C,YAAY,OAAe;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAA;QAJF,QAAG,GAAQ,EAAE,CAAA;IAK7B,CAAC;IAEQ,IAAI,CAAC,GAAG,KAAU;QAEvB,KAAI,MAAM,IAAI,IAAI,KAAK,EACvB,CAAC;YACG,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAClC,CAAC;gBACG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA,CAAC,4BAA4B;YACjD,CAAC;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAC,sBAAsB;QACrD,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACJ;AAtBD,sCAsBC"}
@@ -0,0 +1,192 @@
1
+ import { FileInfo, RangedNumber } from "../structures/structs";
2
+ export declare class TitleAndArtists {
3
+ readonly artists: string[];
4
+ readonly artist: string;
5
+ readonly title: string;
6
+ readonly sanitized_for_seed_artist: string;
7
+ readonly sanitized_for_seed_title: string;
8
+ readonly seed: string;
9
+ readonly hash: string;
10
+ constructor(artists: string[], artist: string, title: string);
11
+ get artistsDashTitle(): string;
12
+ findGeniusLyrics(): Promise<string | undefined>;
13
+ }
14
+ export declare namespace TitleAndArtists {
15
+ function fromFileInfo(fileInfo: FileInfo, aliases?: Aliases): Promise<TitleAndArtists>;
16
+ }
17
+ export declare class Aliases {
18
+ private reverseAliases;
19
+ add(name: string, ...aliases: string[]): Aliases;
20
+ get(name: string): string;
21
+ }
22
+ export declare const MUSIC_ALIASES: Aliases;
23
+ export declare namespace Compare {
24
+ enum NumberCompareOperator {
25
+ Equal = "equal",
26
+ NotEqual = "not_equal",
27
+ GreaterThan = "greater_than",
28
+ GreaterThanOrEqual = "greater_than_or_equal",
29
+ LessThan = "less_than",
30
+ LessThanOrEqual = "less_than_or_equal"
31
+ }
32
+ enum StringCompareOperator {
33
+ Equal = "equal",
34
+ NotEqual = "not_equal",
35
+ Contains = "contains",
36
+ NotContains = "not_contains",
37
+ StartsWith = "starts_with",
38
+ EndsWith = "ends_with"
39
+ }
40
+ type Operator = NumberCompareOperator | StringCompareOperator;
41
+ function fromString(input: string): Operator;
42
+ function compare(value: number | string, operator: Operator): boolean;
43
+ function number(value: number, operator: NumberCompareOperator): boolean;
44
+ function string(value: string, operator: StringCompareOperator): boolean;
45
+ }
46
+ export declare class BoundedDeque<T> {
47
+ readonly maxSize: number;
48
+ private queue;
49
+ constructor(maxSize: number);
50
+ pushEnd(item: T): void;
51
+ pushFront(item: T): void;
52
+ popEnd(): T | undefined;
53
+ popFront(): T | undefined;
54
+ peekFront(): T | undefined;
55
+ peekEnd(): T | undefined;
56
+ get size(): number;
57
+ isEmpty(): boolean;
58
+ isFull(): boolean;
59
+ clear(): void;
60
+ toArray(): T[];
61
+ get array(): T[];
62
+ private trimFrontIfNeeded;
63
+ private trimBackIfNeeded;
64
+ }
65
+ export declare class Timer {
66
+ private _startMs;
67
+ private _lastIncrementMs;
68
+ private _count;
69
+ constructor();
70
+ reset(): void;
71
+ get startMs(): number;
72
+ get elapsedMs(): number;
73
+ get elapsedS(): number;
74
+ increment(incrementBy?: number, updateLoadingBar?: boolean): number;
75
+ get lastIncrementMs(): number;
76
+ get lastIncrementGapMs(): number;
77
+ get lastIncrementGapS(): number;
78
+ get count(): number;
79
+ get countPerSecond(): number;
80
+ get countPerSecondString(): string;
81
+ isFinished(goalCount: number): boolean;
82
+ getETASecondsForCount(goalCount: number): number;
83
+ getETASecondsForCountString(goalCount: number): string;
84
+ getCountAndPercentString(goalCount: number): string;
85
+ getFullStatsString(goalCount: number): string;
86
+ startLoadingBarForS(durationS: number, suffixDecider?: (() => string) | string, onFinish?: () => void, intervalMs?: number, rainbowIntervalMs?: number): NodeJS.Timer;
87
+ updateLoadingBar: () => void;
88
+ startLoadingBarUntilDone(goalCountDecider: (() => number) | number, suffixDecider?: (() => string) | string, onFinish?: () => void, fullStats?: boolean, intervalMs?: number, rainbowIntervalMs?: number): NodeJS.Timer;
89
+ startReplaceLastTerminalLineLoop(stringMaker: () => string, intervalMs?: number): NodeJS.Timer;
90
+ }
91
+ export declare class NumberAnalysis {
92
+ private _lowest;
93
+ private _highest;
94
+ constructor(values?: Iterable<number>);
95
+ updateArray(buffer: Iterable<number>): void;
96
+ update(value: number): void;
97
+ get lowest(): number;
98
+ get highest(): number;
99
+ forEachLowestFirst(consumer: (value: number) => void): void;
100
+ forEachHighestFirst(consumer: (value: number) => void): void;
101
+ forEach(lowestFirst: boolean, consumer: (value: number) => void): void;
102
+ get gap(): number;
103
+ toRangedNumber(): RangedNumber;
104
+ toString(): string;
105
+ }
106
+ export declare class NumbersAnalysis extends NumberAnalysis {
107
+ private _sum;
108
+ readonly array: number[];
109
+ readonly map: Map<number, number>;
110
+ constructor(values?: Iterable<number>);
111
+ update(value: number): void;
112
+ get average(): number;
113
+ get sum(): number;
114
+ get count(): number;
115
+ sortedArray(ascending?: boolean): number[];
116
+ get median(): number;
117
+ getSortedFrequencyKeys(ascending?: boolean): number[];
118
+ toString(): string;
119
+ }
120
+ export declare class Lockable<T> {
121
+ private _locked;
122
+ private _item;
123
+ constructor(item: T);
124
+ get item(): T;
125
+ set item(item: T);
126
+ get locked(): boolean;
127
+ set locked(locked: boolean);
128
+ set(item: T): void;
129
+ get(): T;
130
+ lock(): void;
131
+ unlock(): void;
132
+ toString(): string;
133
+ }
134
+ export declare class Config {
135
+ readonly configPath: string;
136
+ private _init;
137
+ readonly name: string;
138
+ readonly basePath: string;
139
+ private readonly _config;
140
+ constructor(configPath?: string);
141
+ get isInit(): boolean;
142
+ throwIfNotInit(): void;
143
+ throwIfInit(error?: string): void;
144
+ define(key: string, value: number | string | boolean): Config;
145
+ get(key: string): number | string | boolean;
146
+ getString(key: string): string;
147
+ getNumber(key: string): number;
148
+ getBool(key: string): boolean;
149
+ is(key: string): boolean;
150
+ set(key: string, value: number | string | boolean): Config;
151
+ private _set;
152
+ init(): Config;
153
+ save(): Config;
154
+ toString(): string;
155
+ }
156
+ export declare class WeightedMap<T> {
157
+ private readonly _map;
158
+ private _totalWeight;
159
+ constructor();
160
+ add(item: T, weight?: number): WeightedMap<T>;
161
+ get(): T;
162
+ get empty(): boolean;
163
+ get hasItems(): boolean;
164
+ get size(): number;
165
+ }
166
+ export declare namespace WeightedMap {
167
+ function of<T>(input: T | T[]): WeightedMap<T>;
168
+ }
169
+ export type TextCompChild = TextCompObj | TextComp | string;
170
+ export type TextCompChildren = TextCompChild | (TextCompChild)[] | WeightedMap<TextComp>;
171
+ export type TextCompLookupMap = Map<string, WeightedMap<TextCompChild>>;
172
+ export interface TextCompObj {
173
+ text?: string;
174
+ weight?: number;
175
+ chance?: number;
176
+ continueToChildOnFail?: boolean;
177
+ children?: TextCompChildren;
178
+ }
179
+ export declare class TextComp {
180
+ readonly text: string;
181
+ readonly chance: number;
182
+ readonly continueToChildOnFail: boolean;
183
+ private readonly _children;
184
+ constructor(data: TextCompObj);
185
+ get hasChildren(): boolean;
186
+ getRandomChild(): TextComp;
187
+ generate(lookup?: TextCompLookupMap, separator?: string, text?: string): string;
188
+ toString(): string;
189
+ }
190
+ export declare namespace TextComp {
191
+ function of(item: TextCompChild): TextComp;
192
+ }