Skip to content

Commit

Permalink
Bump version 1.0.0 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
samhirtarif authored Jun 6, 2023
1 parent 454dc7a commit 99d3faa
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
reporter: github-pr-review
eslint_flags: "src/"
fail_on_error: "true"
level: "warning"
level: "warning"
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-audio-visualize",
"private": false,
"version": "0.0.3",
"version": "1.0.0",
"license": "MIT",
"author": "",
"repository": {
Expand All @@ -24,9 +24,7 @@
"visualization"
],
"files": [
"dist",
"README.md",
"assets"
"dist"
],
"main": "./dist/react-audio-visualize.umd.js",
"module": "./dist/react-audio-visualize.es.js",
Expand Down
14 changes: 11 additions & 3 deletions src/AudioVisualizer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import { type dataPoint } from "./types";

interface CustomCanvasRenderingContext2D extends CanvasRenderingContext2D {
roundRect: (
x: number,
y: number,
w: number,
h: number,
radius: number
) => void;
}

export const calculateBarData = (
buffer: AudioBuffer,
height: number,
Expand Down Expand Up @@ -68,7 +78,7 @@ export const draw = (
): void => {
const amp = canvas.height / 2;

const ctx = canvas.getContext("2d");
const ctx = canvas.getContext("2d") as CustomCanvasRenderingContext2D;
if (!ctx) return;

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

ctx.beginPath();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
ctx.roundRect(x, y, w, h, 50);
ctx.fill();
});
Expand Down
14 changes: 11 additions & 3 deletions src/LiveAudioVisualizer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
interface CustomCanvasRenderingContext2D extends CanvasRenderingContext2D {
roundRect: (
x: number,
y: number,
w: number,
h: number,
radius: number
) => void;
}

export const calculateBarData = (
frequencyData: Uint8Array,
width: number,
Expand Down Expand Up @@ -35,7 +45,7 @@ export const draw = (
): void => {
const amp = canvas.height / 2;

const ctx = canvas.getContext("2d");
const ctx = canvas.getContext("2d") as CustomCanvasRenderingContext2D;
if (!ctx) return;

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

ctx.beginPath();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
ctx.roundRect(x, y, w, h, 50);
ctx.fill();
});
Expand Down

0 comments on commit 99d3faa

Please sign in to comment.