mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
add webxdc document property to deltachat node typings
This commit is contained in:
@@ -910,6 +910,16 @@ export class Context extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type WebxdcInfo = {
|
||||||
|
name: string
|
||||||
|
icon: string
|
||||||
|
summary: string
|
||||||
|
/**
|
||||||
|
* if set by the webxdc, name of the document in edit
|
||||||
|
*/
|
||||||
|
document?: string
|
||||||
|
}
|
||||||
|
|
||||||
type WebxdcSendingStatusUpdate<T> = {
|
type WebxdcSendingStatusUpdate<T> = {
|
||||||
/** the payload, deserialized json:
|
/** the payload, deserialized json:
|
||||||
* any javascript primitive, array or object. */
|
* any javascript primitive, array or object. */
|
||||||
@@ -923,6 +933,11 @@ type WebxdcSendingStatusUpdate<T> = {
|
|||||||
* it is recommended to use some aggregated value,
|
* it is recommended to use some aggregated value,
|
||||||
* eg. "8 votes", "Highscore: 123" */
|
* eg. "8 votes", "Highscore: 123" */
|
||||||
summary?: string
|
summary?: string
|
||||||
|
/**
|
||||||
|
* optional, name of the document in edit,
|
||||||
|
* must not be used eg. in games where the Webxdc does not create documents
|
||||||
|
*/
|
||||||
|
document?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebxdcReceivedStatusUpdate<T> = {
|
type WebxdcReceivedStatusUpdate<T> = {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import binding from './binding'
|
|||||||
import { C } from './constants'
|
import { C } from './constants'
|
||||||
import { Lot } from './lot'
|
import { Lot } from './lot'
|
||||||
import { Chat } from './chat'
|
import { Chat } from './chat'
|
||||||
|
import { WebxdcInfo } from './context'
|
||||||
const debug = require('debug')('deltachat:node:message')
|
const debug = require('debug')('deltachat:node:message')
|
||||||
|
|
||||||
export enum MessageDownloadState {
|
export enum MessageDownloadState {
|
||||||
@@ -157,7 +158,7 @@ export class Message {
|
|||||||
return binding.dcn_msg_get_chat_id(this.dc_msg)
|
return binding.dcn_msg_get_chat_id(this.dc_msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
get webxdcInfo(): { name: string; icon: string; summary: string } | null {
|
get webxdcInfo(): WebxdcInfo | null {
|
||||||
let info = binding.dcn_msg_get_webxdc_info(this.dc_msg)
|
let info = binding.dcn_msg_get_webxdc_info(this.dc_msg)
|
||||||
return info
|
return info
|
||||||
? JSON.parse(binding.dcn_msg_get_webxdc_info(this.dc_msg))
|
? JSON.parse(binding.dcn_msg_get_webxdc_info(this.dc_msg))
|
||||||
|
|||||||
Reference in New Issue
Block a user