diff --git a/source/index.ts b/source/index.ts index 692815a..cc54804 100644 --- a/source/index.ts +++ b/source/index.ts @@ -259,6 +259,8 @@ export default class Conf = Record(key: Key): void; + // This overload is used for dot-notation access. + delete(key: string): void; delete(key: string): void { const {store} = this; if (this.#options.accessPropertiesByDotNotation) { diff --git a/test/index.test-d.ts b/test/index.test-d.ts index f21aaee..25280e8 100644 --- a/test/index.test-d.ts +++ b/test/index.test-d.ts @@ -73,6 +73,8 @@ expectType(conf.get('foo')); expectType(conf.get('foo', 'bar')); conf.delete('foo'); expectType(conf.has('foo')); +conf.delete('nested.prop'); +expectType(conf.has('nested.prop')); conf.clear(); const off = conf.onDidChange('foo', (oldValue, newValue) => { expectAssignable(oldValue);