---
title: "PromiseLike | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface PromiseLike<T>

interface PromiseLike<[T](#t)\> {  
    [then](#then-1)<[TResult1](#thentresult1) \= [T](#t), [TResult2](#thentresult2) \= never\>(  
        onfulfilled?: ((value: [T](#t)) \=> [TResult1](#thentresult1) | PromiseLike<[TResult1](#thentresult1)\>) | null,  
        onrejected?: ((reason: any) \=> [TResult2](#thentresult2) | PromiseLike<[TResult2](#thentresult2)\>) | null,  
    ): PromiseLike<[TResult1](#thentresult1) | [TResult2](#thentresult2)\>;  
}

#### Type Parameters

-   T

##### Index

### Methods[](#methods)

[then](#then)

## Methods[](#methods-1)

### then[](#then)

-   then<[TResult1](#thentresult1) \= [T](#t), [TResult2](#thentresult2) \= never\>(  
        onfulfilled?: ((value: [T](#t)) \=> [TResult1](#thentresult1) | PromiseLike<[TResult1](#thentresult1)\>) | null,  
        onrejected?: ((reason: any) \=> [TResult2](#thentresult2) | PromiseLike<[TResult2](#thentresult2)\>) | null,  
    ): PromiseLike<[TResult1](#thentresult1) | [TResult2](#thentresult2)\>[](#then-1)
    
    Attaches callbacks for the resolution and/or rejection of the Promise.
    
    #### Type Parameters
    
    -   TResult1 = [T](#t)
    -   TResult2 = never
    
    #### Parameters
    
    -   `Optional`onfulfilled: ((value: [T](#t)) \=> [TResult1](#thentresult1) | PromiseLike<[TResult1](#thentresult1)\>) | null
        
        The callback to execute when the Promise is resolved.
        
    -   `Optional`onrejected: ((reason: any) \=> [TResult2](#thentresult2) | PromiseLike<[TResult2](#thentresult2)\>) | null
        
        The callback to execute when the Promise is rejected.
        
    
    #### Returns PromiseLike<[TResult1](#thentresult1) | [TResult2](#thentresult2)\>
    
    A Promise for the completion of which ever callback is executed.
