@zwa73/utils 1.0.69 → 1.0.71

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.
@@ -101,10 +101,10 @@ export type MethodsThisAs<Methods, T> = {
101
101
  */
102
102
  export declare function assertThisAs<Self, T>(prototype: MethodsThisAs<Self, T>): void;
103
103
  /**可自动混入的类型 */
104
- export type MixinAble<Mixin> = {
104
+ export type Mixinable<Mixin> = {
105
105
  /**可混入的字段 */
106
106
  readonly MIXIN_FIELDS: ReadonlyArray<keyof Mixin>;
107
107
  };
108
- /**自动混入的组合类 */
109
- export type ComposedMixinable<B extends object, Ms extends Array<unknown>> = Ms extends [infer M, ...infer Rest] ? M extends MixinAble<M> ? ComposedMixinable<ComposedClassPart<B, M, M['MIXIN_FIELDS'][number]>, Rest> : B : B;
108
+ /**自动组合可混入的类 */
109
+ export type ComposedMixinable<B extends object, Ms extends Array<unknown>> = Ms extends [infer M, ...infer Rest] ? M extends Mixinable<M> ? ComposedMixinable<ComposedClassPart<B, M, M['MIXIN_FIELDS'][number]>, Rest> : B : B;
110
110
  export {};
@@ -1,12 +1,12 @@
1
- import { MixinAble } from "..";
2
- declare class A implements MixinAble<A> {
1
+ import { Mixinable } from "..";
2
+ declare class A implements Mixinable<A> {
3
3
  private num;
4
4
  getNum: () => number;
5
5
  /**A的函数 */
6
6
  getA: () => this;
7
7
  MIXIN_FIELDS: readonly ["getNum", "getA"];
8
8
  }
9
- declare class B implements MixinAble<B> {
9
+ declare class B implements Mixinable<B> {
10
10
  private text;
11
11
  getText: () => string;
12
12
  /**B的函数 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  import * as crypto from "crypto";
2
- import { ComposedClass, ComposedClassMult, ComposedClassPart, ComposedMixinable, FuncPropNames, JToken, MixinAble, PromiseProcFn, PromiseStat, PromiseVerifyFn } from "@src/UtilInterfaces";
2
+ import { ComposedClass, ComposedClassMult, ComposedClassPart, ComposedMixinable, FuncPropNames, JToken, Mixinable, PromiseProcFn, PromiseStat, PromiseVerifyFn } from "@src/UtilInterfaces";
3
3
  import * as cp from "child_process";
4
4
  import { SLogger } from "@src/UtilLogger";
5
5
 
@@ -256,7 +256,7 @@ export function composeMixinable
256
256
  M1, M2, M3,M4, M5, M6,M7, M8, M9>
257
257
  (base:B,m1?:M1,m2?:M2,m3?:M3,m4?:M4,m5?:M5,m6?:M6,m7?:M7,m8?:M8,m9?:M9):
258
258
  ComposedMixinable<B,[M1,M2,M3,M4,M5,M6,M4,M8,M9]>
259
- export function composeMixinable<Base extends object, Mixin extends MixinAble<Mixin>>(base:Base,...mixins:Mixin[]){
259
+ export function composeMixinable<Base extends object, Mixin extends Mixinable<Mixin>>(base:Base,...mixins:Mixin[]){
260
260
  let out = base;
261
261
  for(const mixin of mixins)
262
262
  out = composeClassPart(base,mixin,...mixin.MIXIN_FIELDS);
@@ -158,15 +158,15 @@ export type MethodsThisAs<Methods, T> = {
158
158
  export function assertThisAs<Self,T>(prototype: MethodsThisAs<Self, T>) {}
159
159
 
160
160
  /**可自动混入的类型 */
161
- export type MixinAble<Mixin> = {
161
+ export type Mixinable<Mixin> = {
162
162
  /**可混入的字段 */
163
163
  readonly MIXIN_FIELDS:ReadonlyArray<keyof Mixin>
164
164
  };
165
165
 
166
- /**自动混入的组合类 */
166
+ /**自动组合可混入的类 */
167
167
  export type ComposedMixinable<B extends object, Ms extends Array<unknown>> =
168
168
  Ms extends [infer M, ...infer Rest]
169
- ? M extends MixinAble<M>
169
+ ? M extends Mixinable<M>
170
170
  ? ComposedMixinable<ComposedClassPart<B,M,M['MIXIN_FIELDS'][number]>,Rest>
171
171
  : B
172
172
  : B
@@ -1,13 +1,13 @@
1
- import { MixinAble, UtilFP, UtilFunc, assertThisAs } from ".."
1
+ import { Mixinable, UtilFP, UtilFunc, assertThisAs } from ".."
2
2
 
3
- class A implements MixinAble<A>{
3
+ class A implements Mixinable<A>{
4
4
  private num = 1;
5
5
  getNum = ()=>this.num;
6
6
  /**A的函数 */
7
7
  getA=()=>this;
8
8
  MIXIN_FIELDS =['getNum','getA'] as const;
9
9
  }
10
- class B implements MixinAble<B>{
10
+ class B implements Mixinable<B>{
11
11
  private text = "B的text";
12
12
  getText = ()=>this.text;
13
13
  /**B的函数 */
@@ -1,7 +0,0 @@
1
- import { FfprobeData } from 'fluent-ffmpeg';
2
- declare class SFfmpegTool {
3
- static setFfmpegPath(ffmpegPath: string): void;
4
- static getAudioData(inputWavPath: string): Promise<FfprobeData | null>;
5
- }
6
- export default SFfmpegTool;
7
- export { SFfmpegTool };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SFfmpegTool = void 0;
4
- const fluentFfmpeg = require("fluent-ffmpeg");
5
- class SFfmpegTool {
6
- static setFfmpegPath(ffmpegPath) {
7
- fluentFfmpeg.setFfmpegPath(ffmpegPath);
8
- }
9
- static async getAudioData(inputWavPath) {
10
- return new Promise((resolve, reject) => {
11
- fluentFfmpeg.ffprobe(inputWavPath, function (err, metadata) {
12
- if (err) {
13
- console.log(err);
14
- resolve(null);
15
- }
16
- else {
17
- //console.log(inputWavPath+" metadata:");
18
- //console.log(metadata);
19
- resolve(metadata);
20
- }
21
- });
22
- });
23
- }
24
- }
25
- exports.SFfmpegTool = SFfmpegTool;
26
- exports.default = SFfmpegTool;