@audio/window 1.0.3 → 1.0.4

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 (2) hide show
  1. package/package.json +9 -4
  2. package/window.d.ts +9 -0
package/package.json CHANGED
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "@audio/window",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Audio-facing window kit — typed fills (periodic/symmetric), apply, COLA check over window-function",
7
7
  "main": "window.js",
8
8
  "exports": {
9
- ".": "./window.js",
9
+ ".": {
10
+ "types": "./window.d.ts",
11
+ "default": "./window.js"
12
+ },
10
13
  "./package.json": "./package.json"
11
14
  },
12
15
  "files": [
13
- "window.js"
16
+ "window.js",
17
+ "*.d.ts"
14
18
  ],
15
19
  "dependencies": {
16
20
  "window-function": "^3.0.1"
@@ -46,5 +50,6 @@
46
50
  "tst": "^9.4.0",
47
51
  "@audio/stft": "^1.0.1"
48
52
  },
49
- "funding": "https://github.com/sponsors/audiojs"
53
+ "funding": "https://github.com/sponsors/audiojs",
54
+ "types": "./window.d.ts"
50
55
  }
package/window.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export * from 'window-function'
2
+ export type WindowName = Exclude<keyof typeof import('window-function'), 'generate' | 'apply' | 'enbw' | 'scallopLoss' | 'cola'>
3
+ /** Fill a window; periodic defaults to true. */
4
+ export default function window(name: WindowName, length: number, options?: { periodic?: boolean }): Float64Array
5
+ /** Multiply in place by a repeating window, returning the same array. */
6
+ export function apply<T extends Float32Array | Float64Array | number[]>(data: T, win: ArrayLike<number>): T
7
+ export function cola(win: ArrayLike<number>, hop: number, options?: { squared?: boolean; tolerance?: number }): {
8
+ ok: boolean; ripple: number; mean: number
9
+ }