Skip to content

Commit

Permalink
fix: file type enum missing
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Jul 9, 2024
1 parent 6c7f6c4 commit d0b81cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export interface Comment {
text: string
}

export const enum FileType {
Client = 'Client',
Server = 'Server',
Isomorphic = 'Isomorphic'
}

export interface ModuleImports {
name: string
}
Expand All @@ -30,7 +36,7 @@ export const enum RSCError {
export function validate(code: string, filePath: string, isServerLayer: boolean): ValidateResult

export interface ValidateResult {
isClientEntry: boolean
fileType: FileType
isServerAction: boolean
error?: RSCError
imports: Array<ModuleImports>
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ if (!nativeBinding) {
throw new Error(`Failed to load native binding`)
}

module.exports.FileType = nativeBinding.FileType
module.exports.reactServerAction = nativeBinding.reactServerAction
module.exports.RSCError = nativeBinding.RSCError
module.exports.validate = nativeBinding.validate

0 comments on commit d0b81cf

Please sign in to comment.