title: using an object property as a type in typescript
body: <p>I have a third party piece of code that is defined as this</p>
  
  <pre><code>export const Actions = {
    findByIdAccessTokens: class implements Action {
              public readonly type = UserActionTypes.FIND_BY_ID_ACCESSTOKENS;
              public payload: { id: any; fk: any; customHeaders };
  
              constructor(
                  id: any,
                  fk: any,
                  customHeaders?: Function,
                  public meta?: any
              ) {
                  this.payload = { id, fk, customHeaders };
              }
          },
  }
  </code></pre>
  
  <p>in my code I want to pass in a parameter that has a type of <code>findByIdAccessTokens</code></p>
  
  <p>however, I can't seem to find a way of being able to tell the compiler that my parameter is of that type</p>
  
  <p>so, for example</p>
  
  <pre><code>import { Actions,ActionTypes } from '@base/sdk/actions'; 
  ...
  filter((action:Actions.findByIdAccessTokens) =&gt; 
  </code></pre>
  
  <p>gives the error <code>[ts] Cannot find namespace 'Actions'.</code></p>
  
  <p>I've tried every combination that I can think if, and unfortunately my google search terms are so generic (class, typed, etc) that I cannot find any article that solves the problem</p>
  
  <p>I know if I define and export a class</p>
  
  <pre><code>export class findByIdAccessTokens implements Action {
          public readonly type = UserActionTypes.FIND_BY_ID_ACCESSTOKENS;
          public payload: { id: any; fk: any; customHeaders };
  
          constructor(
              id: any,
              fk: any,
              customHeaders?: Function,
              public meta?: any
          ) {
              this.payload = { id, fk, customHeaders };
          }
      },
  </code></pre>
  
  <p>and import that directly, then </p>
  
  <pre><code>import { updateByIdAccessTokensSuccess } from '@base/sdk/actions';
  ...
  filter((action:findByIdAccessTokens) =&gt; 
  </code></pre>
  
  <p>compiles just fine (along with the type safety) </p>