File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed
Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change 11import type { TailwindPluginOptions } from "./types.ts" ;
22import { initTailwind } from "./compiler.ts" ;
3- import type { FreshBuilder } from "fresh/dev" ;
3+ import type { Builder } from "fresh/dev" ;
44import type { App } from "fresh" ;
55
66export function tailwind < T > (
7- builder : FreshBuilder ,
7+ builder : Builder ,
88 app : App < T > ,
99 options : TailwindPluginOptions = { } ,
1010) : void {
Original file line number Diff line number Diff line change @@ -35,24 +35,15 @@ export interface BuildOptions {
3535 target ?: string | string [ ] ;
3636}
3737
38- export interface FreshBuilder {
39- onTransformStaticFile (
40- options : OnTransformOptions ,
41- callback : TransformFn ,
42- ) : void ;
43- build < T > ( app : App < T > , options ?: BuildOptions ) : Promise < void > ;
44- listen < T > ( app : App < T > , options ?: ListenOptions & BuildOptions ) : Promise < void > ;
45- }
46-
47- export class Builder implements FreshBuilder {
38+ export class Builder {
4839 #transformer = new FreshFileTransformer ( fsAdapter ) ;
4940 #addedInternalTransforms = false ;
50- #options: { target : string | string [ ] } ;
41+ #options: Required < BuildOptions > ;
5142 #chunksReady = Promise . withResolvers < void > ( ) ;
5243
53- constructor ( options : BuildOptions = { } ) {
44+ constructor ( options ? : BuildOptions ) {
5445 this . #options = {
55- target : options . target ?? [ "chrome99" , "firefox99" , "safari15" ] ,
46+ target : options ? .target ?? [ "chrome99" , "firefox99" , "safari15" ] ,
5647 } ;
5748 }
5849
Original file line number Diff line number Diff line change 1- export { Builder , type FreshBuilder } from "./builder.ts" ;
1+ export { Builder } from "./builder.ts" ;
22export {
33 type OnTransformArgs ,
44 type OnTransformOptions ,
You can’t perform that action at this time.
0 commit comments