nitro-codegen
Version:
The code-generator for react-native-nitro-modules.
36 lines (32 loc) • 791 B
text/typescript
import type { Language } from '../../getPlatformSpecs.js'
import type { SourceFile, SourceImport } from '../SourceFile.js'
import type { Type, TypeKind } from './Type.js'
export class BooleanType implements Type {
get canBePassedByReference(): boolean {
// It's a primitive.
return false
}
get kind(): TypeKind {
return 'boolean'
}
getCode(language: Language): string {
switch (language) {
case 'c++':
return 'bool'
case 'swift':
return 'Bool'
case 'kotlin':
return 'Boolean'
default:
throw new Error(
`Language ${language} is not yet supported for BooleanType!`
)
}
}
getExtraFiles(): SourceFile[] {
return []
}
getRequiredImports(): SourceImport[] {
return []
}
}