<p dir="auto">I worked around <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="148424102" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/8091" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/8091/hovercard" href="https://github.com/microsoft/TypeScript/issues/8091">#8091</a> by adding to the top of <code class="notranslate">lib.webworker.d.ts</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="interface IDBIndexParameters {
    multiEntry?: boolean;
    unique?: boolean;
}
type IDBKeyPath = string;
interface IDBObjectStoreParameters {
    autoIncrement?: boolean;
    keyPath?: IDBKeyPath;
}"><pre class="notranslate"><code class="notranslate">interface IDBIndexParameters {
    multiEntry?: boolean;
    unique?: boolean;
}
type IDBKeyPath = string;
interface IDBObjectStoreParameters {
    autoIncrement?: boolean;
    keyPath?: IDBKeyPath;
}
</code></pre></div>
<p dir="auto">now I get another error:</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">nightly (1.9.0-dev.20160409)</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ npm install rxjs
$ cat tsconfig.json
{
    &quot;compilerOptions&quot;: {
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;target&quot;: &quot;es5&quot;,
        &quot;lib&quot;: [&quot;webworker&quot;, &quot;es6&quot;],
        &quot;noImplicitAny&quot;: false,
        &quot;sourceMap&quot;: false
    },
    &quot;exclude&quot;: [
        &quot;node_modules&quot;
    ],
    &quot;files&quot;: [&quot;repro.ts&quot;]
}
$ cat repro.ts
import * as o from 'rxjs/observable/FromEventObservable';"><pre class="notranslate">$ npm install rxjs
$ cat tsconfig.json
{
    <span class="pl-s"><span class="pl-pds">"</span>compilerOptions<span class="pl-pds">"</span></span>: {
        <span class="pl-s"><span class="pl-pds">"</span>module<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>commonjs<span class="pl-pds">"</span></span>,
        <span class="pl-s"><span class="pl-pds">"</span>target<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>es5<span class="pl-pds">"</span></span>,
        <span class="pl-s"><span class="pl-pds">"</span>lib<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>webworker<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>es6<span class="pl-pds">"</span></span>],
        <span class="pl-s"><span class="pl-pds">"</span>noImplicitAny<span class="pl-pds">"</span></span>: false,
        <span class="pl-s"><span class="pl-pds">"</span>sourceMap<span class="pl-pds">"</span></span>: <span class="pl-c1">false</span>
    },
    <span class="pl-s"><span class="pl-pds">"</span>exclude<span class="pl-pds">"</span></span>: [
        <span class="pl-s"><span class="pl-pds">"</span>node_modules<span class="pl-pds">"</span></span>
    ],
    <span class="pl-s"><span class="pl-pds">"</span>files<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>repro.ts<span class="pl-pds">"</span></span>]
}
$ cat repro.ts
import <span class="pl-k">*</span> as o from <span class="pl-s"><span class="pl-pds">'</span>rxjs/observable/FromEventObservable<span class="pl-pds">'</span></span><span class="pl-k">;</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules/rxjs/observable/FromEventObservable.d.ts(11,104): error TS2304: Cannot find name 'NodeList'.
node_modules/rxjs/observable/FromEventObservable.d.ts(11,115): error TS2304: Cannot find name 'HTMLCollection'."><pre class="notranslate"><code class="notranslate">node_modules/rxjs/observable/FromEventObservable.d.ts(11,104): error TS2304: Cannot find name 'NodeList'.
node_modules/rxjs/observable/FromEventObservable.d.ts(11,115): error TS2304: Cannot find name 'HTMLCollection'.
</code></pre></div>
<p dir="auto">I want a type similar to 'any' but can be initialized only with Object compatible type.<br>
Is it possible to do this ?</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var a : {any};

a.x = 1; // OK
a[&quot;x&quot;] = 1; // OK
a = {}; // OK
a = 1; // Error !"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">a</span> : <span class="pl-kos">{</span><span class="pl-c1">any</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-c1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// OK</span>
<span class="pl-s1">a</span><span class="pl-kos">[</span><span class="pl-s">"x"</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// OK</span>
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// OK</span>
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Error !</span></pre></div>
<p dir="auto">The workaround is to use indexer, but then syntax 'a.x' doesn't work.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var a: {[key: string]: any;};

a = 1; // Error"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">a</span>: <span class="pl-kos">{</span><span class="pl-kos">[</span><span class="pl-s1">key</span>: <span class="pl-smi">string</span><span class="pl-kos">]</span>: <span class="pl-smi">any</span><span class="pl-kos">;</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Error</span></pre></div>