Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace keyword: module -> namespace #235

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/generator-typescript/src/module-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class ModuleGenerator extends FormatGenerator<string[]> {
const hasNamespace = isGObject || hasStaticFunctions || node.callbacks.length > 0

return [
...this.generateClassModules(node),
...this.generateClassNamespaces(node),
...(hasNamespace ? this.generateInterfaceNamespace(node) : []),
...this.generateImplementationInterface(node),
...(hasNamespace ? this.generateInterfaceDeclaration(node) : []),
Expand Down Expand Up @@ -1264,7 +1264,7 @@ export class ModuleGenerator extends FormatGenerator<string[]> {
return def
}

generateClassModules(girClass: IntrospectedClass | IntrospectedRecord | IntrospectedInterface, indentCount = 0) {
generateClassNamespaces(girClass: IntrospectedClass | IntrospectedRecord | IntrospectedInterface, indentCount = 0) {
const def: string[] = []
const bodyDef: string[] = []
if (!girClass) return def
Expand All @@ -1289,7 +1289,7 @@ export class ModuleGenerator extends FormatGenerator<string[]> {

// START BODY
{
def.push(`${indent}${exp}module ${girClass.name} {`)
def.push(`${indent}${exp}namespace ${girClass.name} {`)

// Properties interface for construction
def.push(...bodyDef)
Expand Down Expand Up @@ -1415,7 +1415,7 @@ export class ModuleGenerator extends FormatGenerator<string[]> {
generateClass(girClass: IntrospectedClass | IntrospectedRecord) {
const def: string[] = []

def.push(...this.generateClassModules(girClass))
def.push(...this.generateClassNamespaces(girClass))

def.push(...this.addGirDocComment(girClass.doc, [], 0))

Expand Down Expand Up @@ -1758,7 +1758,7 @@ function promisifyIfEnabled(
): IntrospectedClassFunction[] {
if (options.promisify) {
// TODO: Remove this once the type is fixed

return promisifyFunctions(functions)
}

Expand Down