Last active
          September 18, 2017 14:49 
        
      - 
      
- 
        Save MeirionHughes/042d257a2607b31f5ce9c95e85330f76 to your computer and use it in GitHub Desktop. 
    level-sublevel @v2 typing
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import * as levelup from "levelup"; | |
| export = sublevel | |
| declare namespace sublevel { | |
| interface Hook { | |
| (ch: any, add: (op: SublevelBatch | boolean) => void): void; | |
| } | |
| interface SublevelBatch< | |
| TKey=any, | |
| TValue=any, | |
| TOptions=any, | |
| TPutOptions=any, | |
| TGetOptions=any, | |
| TDeleteOptions=any, | |
| TIteratorOptions=any, | |
| TBatchOptions=any> | |
| extends levelup.Batch { | |
| prefix?: Sublevel<TKey, TValue, TOptions, TPutOptions, TGetOptions, TDeleteOptions, TIteratorOptions, TBatchOptions>; | |
| } | |
| interface Sublevel< | |
| TKey=any, | |
| TValue=any, | |
| TOptions=any, | |
| TPutOptions=any, | |
| TGetOptions=any, | |
| TDeleteOptions=any, | |
| TIteratorOptions=any, | |
| TBatchOptions=any> | |
| extends levelup.LevelUp< | |
| TKey, | |
| TValue, | |
| TOptions, | |
| TPutOptions, | |
| TGetOptions, | |
| TDeleteOptions, | |
| TIteratorOptions, | |
| TBatchOptions, | |
| SublevelBatch> { | |
| sublevel(key: string): Sublevel< | |
| TKey, | |
| TValue, | |
| TOptions, | |
| TPutOptions, | |
| TGetOptions, | |
| TDeleteOptions, | |
| TIteratorOptions, | |
| TBatchOptions> | |
| pre(hook: Hook): Function; | |
| } | |
| } | |
| declare function sublevel< | |
| TKey=any, | |
| TValue=any, | |
| TOptions=any, | |
| TPutOptions=any, | |
| TGetOptions=any, | |
| TDeleteOptions=any, | |
| TIteratorOptions=any, | |
| TBatchOptions=any | |
| >( | |
| levelup: levelup.LevelUp<TKey, TValue, TOptions, TPutOptions, TGetOptions, TDeleteOptions, TIteratorOptions, TBatchOptions> | |
| ): sublevel.Sublevel<TKey, TValue, TOptions, TPutOptions, TGetOptions, TDeleteOptions, TIteratorOptions, TBatchOptions> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment