Skip to content

Commit 99d3faa

Browse files
authored
Bump version 1.0.0 (#2)
1 parent 454dc7a commit 99d3faa

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
reporter: github-pr-review
1919
eslint_flags: "src/"
2020
fail_on_error: "true"
21-
level: "warning"
21+
level: "warning"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-audio-visualize",
33
"private": false,
4-
"version": "0.0.3",
4+
"version": "1.0.0",
55
"license": "MIT",
66
"author": "",
77
"repository": {
@@ -24,9 +24,7 @@
2424
"visualization"
2525
],
2626
"files": [
27-
"dist",
28-
"README.md",
29-
"assets"
27+
"dist"
3028
],
3129
"main": "./dist/react-audio-visualize.umd.js",
3230
"module": "./dist/react-audio-visualize.es.js",

src/AudioVisualizer/utils.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import { type dataPoint } from "./types";
22

3+
interface CustomCanvasRenderingContext2D extends CanvasRenderingContext2D {
4+
roundRect: (
5+
x: number,
6+
y: number,
7+
w: number,
8+
h: number,
9+
radius: number
10+
) => void;
11+
}
12+
313
export const calculateBarData = (
414
buffer: AudioBuffer,
515
height: number,
@@ -68,7 +78,7 @@ export const draw = (
6878
): void => {
6979
const amp = canvas.height / 2;
7080

71-
const ctx = canvas.getContext("2d");
81+
const ctx = canvas.getContext("2d") as CustomCanvasRenderingContext2D;
7282
if (!ctx) return;
7383

7484
ctx.clearRect(0, 0, canvas.width, canvas.height);
@@ -91,8 +101,6 @@ export const draw = (
91101
const h = amp + dp.max - y;
92102

93103
ctx.beginPath();
94-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
95-
// @ts-expect-error
96104
ctx.roundRect(x, y, w, h, 50);
97105
ctx.fill();
98106
});

src/LiveAudioVisualizer/utils.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
interface CustomCanvasRenderingContext2D extends CanvasRenderingContext2D {
2+
roundRect: (
3+
x: number,
4+
y: number,
5+
w: number,
6+
h: number,
7+
radius: number
8+
) => void;
9+
}
10+
111
export const calculateBarData = (
212
frequencyData: Uint8Array,
313
width: number,
@@ -35,7 +45,7 @@ export const draw = (
3545
): void => {
3646
const amp = canvas.height / 2;
3747

38-
const ctx = canvas.getContext("2d");
48+
const ctx = canvas.getContext("2d") as CustomCanvasRenderingContext2D;
3949
if (!ctx) return;
4050

4151
ctx.clearRect(0, 0, canvas.width, canvas.height);
@@ -54,8 +64,6 @@ export const draw = (
5464
const h = dp || 1;
5565

5666
ctx.beginPath();
57-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
58-
// @ts-expect-error
5967
ctx.roundRect(x, y, w, h, 50);
6068
ctx.fill();
6169
});

0 commit comments

Comments
 (0)