0.0.16 • Published 7 months ago

aiwow-cap v0.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

aiwow-cap

For aiwow natvie

Install

npm install aiwow-cap
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
ParamType
options{ value: string; }

Returns: Promise<{ value: string; }>


getAudioDevices()

getAudioDevices() => Promise<AudioDevice>

Returns: Promise<AudioDevice>


setAudioModeInCall()

setAudioModeInCall() => Promise<void>

setAudioModeNormal()

setAudioModeNormal() => Promise<void>

getRecentPhotos(...)

getRecentPhotos(options: { pageIndex: number; pageSize: number; }) => Promise<PhotosReturn>
ParamType
options{ pageIndex: number; pageSize: number; }

Returns: Promise<PhotosReturn>


getMediaByFolder(...)

getMediaByFolder(options: { pageIndex: number; pageSize: number; }) => Promise<PhotosReturn>
ParamType
options{ pageIndex: number; pageSize: number; }

Returns: Promise<PhotosReturn>


getMediaFolders(...)

getMediaFolders(options: { pageIndex: number; pageSize: number; folderPath: string; }) => Promise<PhotosFoldersReturn>
ParamType
options{ pageIndex: number; pageSize: number; folderPath: string; }

Returns: Promise<PhotosFoldersReturn>


gotoSettings()

gotoSettings() => Promise<void>

getAssetData(...)

getAssetData(options: { assetId: string; isOriginal: boolean; }) => Promise<any>
ParamType
options{ assetId: string; isOriginal: boolean; }

Returns: Promise<any>


open(...)

open(options: OpenOptions) => Promise<any>
ParamType
optionsOpenOptions

Returns: Promise<any>


clearCookies(...)

clearCookies(options: ClearCookieOptions) => Promise<any>

Clear cookies of url

ParamType
optionsClearCookieOptions

Returns: Promise<any>

Since: 0.5.0


clearAllCookies()

clearAllCookies() => Promise<any>

Clear all cookies

Returns: Promise<any>

Since: 6.5.0


clearCache()

clearCache() => Promise<any>

Clear cache

Returns: Promise<any>

Since: 6.5.0


getCookies(...)

getCookies(options: GetCookieOptions) => Promise<Record<string, string>>

Get cookies for a specific URL.

ParamTypeDescription
optionsGetCookieOptionsThe options, including the URL to get cookies for.

Returns: Promise<Record<string, string>>


close()

close() => Promise<any>

Close the webview.

Returns: Promise<any>


openWebView(...)

openWebView(options: OpenWebViewOptions) => Promise<any>

Open url in a new webview with toolbars

ParamType
optionsOpenWebViewOptions

Returns: Promise<any>

Since: 0.1.0


executeScript(...)

executeScript({ code }: { code: string; }) => Promise<void>

Injects JavaScript code into the InAppBrowser window.

ParamType
__0{ code: string; }

postMessage(...)

postMessage(options: { detail: Record<string, any>; }) => Promise<void>

Sends an event to the webview. you can listen to this event with addListener("messageFromWebview", listenerFunc: (event: Record<string, any>) => void) detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.

ParamType
options{ detail: Record<string, any>; }

setUrl(...)

setUrl(options: { url: string; }) => Promise<any>

Sets the URL of the webview.

ParamType
options{ url: string; }

Returns: Promise<any>


addListener('urlChangeEvent', ...)

addListener(eventName: 'urlChangeEvent', listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle>

Listen for url change, only for openWebView

ParamType
eventName'urlChangeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle>

Since: 0.0.1


addListener('buttonNearDoneClick', ...)

addListener(eventName: 'buttonNearDoneClick', listenerFunc: ButtonNearListener) => Promise<PluginListenerHandle>
ParamType
eventName'buttonNearDoneClick'
listenerFuncButtonNearListener

Returns: Promise<PluginListenerHandle>


addListener('closeEvent', ...)

addListener(eventName: 'closeEvent', listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle>

Listen for close click only for openWebView

ParamType
eventName'closeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle>

Since: 0.4.0


addListener('confirmBtnClicked', ...)

addListener(eventName: 'confirmBtnClicked', listenerFunc: ConfirmBtnListener) => Promise<PluginListenerHandle>

Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS

ParamType
eventName'confirmBtnClicked'
listenerFuncConfirmBtnListener

Returns: Promise<PluginListenerHandle>

Since: 0.0.1


addListener('messageFromWebview', ...)

addListener(eventName: 'messageFromWebview', listenerFunc: (event: { detail: Record<string, any>; }) => void) => Promise<PluginListenerHandle>

Will be triggered when event is sent from webview, to send an event to the webview use window.mobileApp.postMessage({ "detail": { "message": "myMessage" } }) detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.

This method is inject at runtime in the webview

ParamType
eventName'messageFromWebview'
listenerFunc(event: { detail: Record<string, any>; }) => void

Returns: Promise<PluginListenerHandle>


addListener('browserPageLoaded', ...)

addListener(eventName: 'browserPageLoaded', listenerFunc: () => void) => Promise<PluginListenerHandle>

Will be triggered when page is loaded

ParamType
eventName'browserPageLoaded'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>


addListener('pageLoadError', ...)

addListener(eventName: 'pageLoadError', listenerFunc: () => void) => Promise<PluginListenerHandle>

Will be triggered when page load error

ParamType
eventName'pageLoadError'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0


reload()

reload() => Promise<any>

Reload the current web page.

Returns: Promise<any>

Since: 1.0.0


Interfaces

AudioDevice

PropType
inputDevices{ id: string; name: string; type: string; }[]
outputDevices{ id: string; name: string; type: string; }[]

PhotosReturn

PropType
photos{ id: string; path: string; displayName: string; size: number; dateModified: number; mimeType: string; folderName?: string; duration?: number; thumbnailBase64?: number; }[]

PhotosFoldersReturn

PropType
photos{ path: string; imageCount: string; videoCount: number; }[]

OpenOptions

PropTypeDescriptionSince
urlstringTarget URL to load.0.1.0
headersHeadersHeaders to send with the request.0.1.0
credentialsCredentialsCredentials to send with the request and all subsequent requests for the same host.6.1.0
isPresentAfterPageLoadbooleanif true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.0.1.0
preventDeeplinkboolean

Headers

Credentials

PropType
usernamestring
passwordstring

ClearCookieOptions

PropType
urlstring

HttpCookie

PropTypeDescription
urlstringThe URL of the cookie.
keystringThe key of the cookie.
valuestringThe value of the cookie.

GetCookieOptions

PropType
urlstring
includeHttpOnlyboolean

OpenWebViewOptions

PropTypeDescriptionDefaultSince
urlstring要加载的目标 URL 地址。0.1.0
headersHeaders发送请求时携带的 header 信息。0.1.0
credentialsCredentials发送请求和针对相同主机的后续所有请求时携带的凭据信息。6.1.0
shareDisclaimerDisclaimerOptions分享选项0.1.0
toolbarTypeToolBarType工具栏类型ToolBarType.DEFAULT0.1.0
shareSubjectstring分享主题0.1.0
titlestring浏览器的标题'新窗口'0.1.0
backgroundColorBackgroundColor浏览器的背景颜色,仅限 iOSBackgroundColor.BLACK0.1.0
activeNativeNavigationForWebviewboolean如果为 true,则激活 webview 中的原生导航,仅限 Androidfalse
disableGoBackOnNativeApplicationboolean禁用返回到原生应用的功能,可用于强制用户留在 webview 中,仅限 Androidfalse
isPresentAfterPageLoadboolean以新窗口全屏打开 URL isPresentAfterPageLoad: 如果为 true,则浏览器将在页面加载完成后呈现,如果为 false,则浏览器将立即呈现。false0.1.0
isInspectableboolean网站在 webview 中是否可被检查,仅限 iosfalse
isAnimatedbooleanwebview 打开是否带有动画,仅限 iostrue
showReloadButtonboolean显示一个重新加载网页的按钮false1.0.15
closeModalbooleanCloseModal: 如果为 true,当用户点击关闭按钮时会显示确认框,如果为 false,则浏览器将立即关闭。false1.1.0
closeModalTitlestringCloseModalTitle: 用户点击关闭按钮时的确认框标题,仅限 iOS'关闭'1.1.0
closeModalDescriptionstringCloseModalDescription: 用户点击关闭按钮时的确认框描述,仅限 iOS'您确定要关闭此窗口吗?'1.1.0
closeModalOkstringCloseModalOk: 用户点击关闭按钮时的确认按钮文本,仅限 iOS'关闭'1.1.0
closeModalCancelstringCloseModalCancel: 用户点击关闭按钮时的取消按钮文本,仅限 iOS'取消'1.1.0
visibleTitlebooleanvisibleTitle: 如果为 true,则显示网站标题,否则为空true1.2.5
toolbarColorstringtoolbarColor: 工具栏颜色,十六进制格式'#ffffff'1.2.5
showArrowbooleanshowArrow: 如果为 true,则在关闭窗口时显示箭头而不是叉号。false1.2.5
ignoreUntrustedSSLErrorbooleanignoreUntrustedSSLError: 如果为 true,则 webview 将忽略不受信任的 SSL 错误,允许用户查看网站 *false6.1.0
preShowScriptstringpreShowScript: 如果 isPresentAfterPageLoad 为 true 并且设置了此变量,则插件将在显示浏览器之前注入一个脚本。此脚本将以异步方式运行。插件将等待脚本完成 (最多 10 秒)。 *6.6.0
buttonNearDone{ ios: { iconType: 'sf-symbol' | 'asset'; icon: string; }; android: { iconType: 'asset'; icon: string; width?: number; height?: number; }; }buttonNearDone: 允许创建自定义按钮。有关详细信息,请参阅 buttonNearDone.md。 *6.7.0

DisclaimerOptions

PropType
titlestring
messagestring
confirmBtnstring
cancelBtnstring

PluginListenerHandle

PropType
remove() => Promise<void>

UrlEvent

PropTypeDescriptionSince
urlstringEmit when the url changes0.0.1

BtnEvent

PropTypeDescriptionSince
urlstringEmit when a button is clicked.0.0.1

Type Aliases

ClearCookieOptions

Omit<HttpCookie, 'key' | 'value'>

Omit

Construct a type with the properties of T except for those in type K.

Pick<T, Exclude<keyof T, K>>

Pick

From T, pick a set of properties whose keys are in the union K

{ P in K: TP; }

Exclude

Exclude from T those types that are assignable to U

T extends U ? never : T

Record

Construct a type with a set of properties K of type T

{

}

GetCookieOptions

Omit<HttpCookie, 'key' | 'value'>

UrlChangeListener

(state: UrlEvent): void

ButtonNearListener

(state: any): void

ConfirmBtnListener

(state: BtnEvent): void

Enums

ToolBarType

MembersValue
ACTIVITY'activity'
NAVIGATION'navigation'
BLANK'blank'
DEFAULT''

BackgroundColor

MembersValue
WHITE'white'
BLACK'black'
0.0.14

7 months ago

0.0.15

7 months ago

0.0.16

7 months ago

0.0.11

9 months ago

0.0.12

9 months ago

0.0.13

9 months ago

0.0.10

9 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.3

11 months ago