iOS:add ListItem actions api

This commit is contained in:
pengfei.zhou
2021-04-23 19:05:33 +08:00
committed by osborn
parent cc7df5d2ca
commit e18b7e781e
18 changed files with 167 additions and 36 deletions

8
doric-js/index.d.ts vendored
View File

@@ -587,11 +587,17 @@ declare module 'doric/lib/src/widget/list' {
import { View, Superview, NativeViewModel } from "doric/lib/src/ui/view";
import { Stack } from "doric/lib/src/widget/layouts";
import { BridgeContext } from "doric/lib/src/runtime/global";
import { Color } from "doric/lib/src/util/color";
export class ListItem extends Stack {
/**
* Set to reuse native view
*/
identifier?: string;
actions?: {
title: string;
backgroundColor?: Color;
callback: () => void;
}[];
}
export class List extends Superview {
allSubviews(): IterableIterator<ListItem> | ListItem[];
@@ -1187,7 +1193,7 @@ declare module 'doric/lib/src/util/types' {
export interface Modeling {
toModel(): Model;
}
export function obj2Model(obj: Model): Model;
export function obj2Model(obj: Model, convertor: (v: Function) => string): Model;
type _M = string | number | boolean | Modeling | {
[index: string]: Model;
} | undefined;