Skip to content

Commit

Permalink
Update Typescript definition - added mbtiles.db & mbtiles.uri
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Jul 31, 2017
1 parent 909580e commit 01e5ec1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Changelog

## 3.1.1 - 2017-07-30

- Update Typescript definition - added `mbtiles.db` & `mbtiles.uri`

## 3.1.0 - 2017-07-18

- Dropped automatic conversion of JPG to JPEG (MBTiles spec uses `jpg`)
Expand Down
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// <reference types="geojson" />

import {Database} from 'sqlite3-offline'

type Tile = MBTiles.Tile
type Metadata = MBTiles.Metadata
type UpdateMetadata = MBTiles.UpdateMetadata
Expand All @@ -17,6 +19,7 @@ interface SchemaType {
}

declare class MBTilesClass<T extends Tile | string> {
// Metadata properties
type: string
version: string
name?: string
Expand All @@ -29,6 +32,13 @@ declare class MBTilesClass<T extends Tile | string> {
attribution?: string
url?: string

// Extra properties
db?: Database
uri?: string
errors?: any[]
ok?: boolean
schema?: string

constructor(uri: string, schema?: Schema)

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mbtiles-offline",
"version": "3.1.0",
"version": "3.1.1",
"description": "MBTiles SQLite3 binding (for offline environments)",
"main": "index.js",
"types": "index.d.js",
Expand Down
4 changes: 4 additions & 0 deletions types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const options = {
async function main() {
const tile: Tile = [0, 0, 0]
const db = new MBTiles('./in/plain_1.mbtiles', 'tms')
// Class properties
db.db
db.uri
// Class methods
await db.metadata()
await db.count()
await db.tables()
Expand Down

0 comments on commit 01e5ec1

Please sign in to comment.