-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
2@rc
Given:
// typings1.d.ts
declare module 'knex' {
export interface Test {
foo: string
}
}
// typings2.d.ts
declare module 'knex' {
export interface Test {
bar: string
}
}
import {Test} from 'knex';
let y: Test = {} as any;
y.foo
y.bar
This works fine. However, given:
// typings1.d.ts
declare module 'knex' {
namespace Knex {
const foo: string
interface Transaction {
foo: string
}
}
export default Knex;
}
// typings2.d.ts
declare module 'knex' {
namespace Knex {
const bar: string
interface Transaction {
bar: string
}
}
}
import Knex from 'knex';
Knex.foo
Knex.bar // error
let y: Knex.Transaction = {};
y.foo
y.bar // error
It appears my namespace Knex
is not being merged, because I can only access identifiers from typings1.d.ts
. Why is this?
huan and shroo-paulli
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code