Skip to content

Commit

Permalink
Change Buffer to Uint8Array in node/index.d.ts (#530)
Browse files Browse the repository at this point in the history
This makes it easier to use the interfaces from non-Node contexts like
Deno (e.g. Deno.readFile returns an Uint8Array[1]).  The Buffer
interface extends Uint8Array so this change should be compatible.

[1]: https://deno.land/api@v1.34.3?s=Deno.readFile
  • Loading branch information
not-my-profile committed Aug 19, 2023
1 parent 4956d9b commit 0f30348
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface TransformOptions<C extends CustomAtRules> {
/** The filename being transformed. Used for error messages and source maps. */
filename: string,
/** The source code to transform. */
code: Buffer,
code: Uint8Array,
/** Whether to enable minification. */
minify?: boolean,
/** Whether to output a source map. */
Expand Down Expand Up @@ -280,9 +280,9 @@ export interface PseudoClasses {

export interface TransformResult {
/** The transformed code. */
code: Buffer,
code: Uint8Array,
/** The generated source map, if enabled. */
map: Buffer | void,
map: Uint8Array | void,
/** CSS module exports, if enabled. */
exports: CSSModuleExports | void,
/** CSS module references, if `dashedIdents` is enabled. */
Expand Down Expand Up @@ -404,7 +404,7 @@ export interface TransformAttributeOptions {
/** The filename in which the style attribute appeared. Used for error messages and dependencies. */
filename?: string,
/** The source code to transform. */
code: Buffer,
code: Uint8Array,
/** Whether to enable minification. */
minify?: boolean,
/** The browser targets for the generated code. */
Expand Down Expand Up @@ -433,7 +433,7 @@ export interface TransformAttributeOptions {

export interface TransformAttributeResult {
/** The transformed code. */
code: Buffer,
code: Uint8Array,
/** `@import` and `url()` dependencies, if enabled. */
dependencies: Dependency[] | void,
/** Warnings that occurred during compilation. */
Expand Down

0 comments on commit 0f30348

Please sign in to comment.