From 5fc770f62a2c086ebf9f350429f8d092ead614d3 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 30 Apr 2021 14:47:34 +0800 Subject: [PATCH] feat:add comments --- doric-js/index.d.ts | 159 ++++++++++++---------- doric-js/lib/src/widget/flowlayout.d.ts | 3 + doric-js/lib/src/widget/list.d.ts | 3 + doric-js/lib/src/widget/nestedSlider.d.ts | 3 + doric-js/lib/src/widget/scroller.d.ts | 3 + doric-js/lib/src/widget/slider.d.ts | 3 + doric-js/src/widget/flowlayout.ts | 4 +- doric-js/src/widget/list.ts | 4 +- doric-js/src/widget/nestedSlider.ts | 4 +- doric-js/src/widget/scroller.ts | 4 +- doric-js/src/widget/slider.ts | 4 +- 11 files changed, 117 insertions(+), 77 deletions(-) diff --git a/doric-js/index.d.ts b/doric-js/index.d.ts index 45637055..f00ab46e 100644 --- a/doric-js/index.d.ts +++ b/doric-js/index.d.ts @@ -589,40 +589,43 @@ declare module 'doric/lib/src/widget/list' { 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; - }[]; + /** + * Set to reuse native view + */ + identifier?: string; + actions?: { + title: string; + backgroundColor?: Color; + callback: () => void; + }[]; } export class List extends Superview { - allSubviews(): IterableIterator | ListItem[]; - itemCount: number; - renderItem: (index: number) => ListItem; - batchCount: number; - onLoadMore?: () => void; - loadMore?: boolean; - loadMoreView?: ListItem; - onScroll?: (offset: { - x: number; - y: number; - }) => void; - onScrollEnd?: (offset: { - x: number; - y: number; - }) => void; - scrolledPosition?: number; - scrollable?: boolean; - bounces?: boolean; - scrollToItem(context: BridgeContext, index: number, config?: { - animated?: boolean; - }): Promise; - reset(): void; - toModel(): NativeViewModel; + allSubviews(): IterableIterator | ListItem[]; + itemCount: number; + renderItem: (index: number) => ListItem; + batchCount: number; + onLoadMore?: () => void; + loadMore?: boolean; + loadMoreView?: ListItem; + onScroll?: (offset: { + x: number; + y: number; + }) => void; + onScrollEnd?: (offset: { + x: number; + y: number; + }) => void; + scrolledPosition?: number; + scrollable?: boolean; + /** + * Take effect only on iOS + */ + bounces?: boolean; + scrollToItem(context: BridgeContext, index: number, config?: { + animated?: boolean; + }): Promise; + reset(): void; + toModel(): NativeViewModel; } export function list(config: Partial): List; export function listItem(item: View | View[], config?: Partial): ListItem; @@ -633,22 +636,25 @@ declare module 'doric/lib/src/widget/slider' { import { Stack } from "doric/lib/src/widget/layouts"; import { BridgeContext } from "doric/lib/src/runtime/global"; export class SlideItem extends Stack { - /** - * Set to reuse native view - */ - identifier?: string; + /** + * Set to reuse native view + */ + identifier?: string; } export class Slider extends Superview { - allSubviews(): IterableIterator; - itemCount: number; - renderPage: (index: number) => SlideItem; - batchCount: number; - onPageSlided?: (index: number) => void; - loop?: boolean; - scrollable?: boolean; - bounces?: boolean; - slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise; - getSlidedPage(context: BridgeContext): Promise; + allSubviews(): IterableIterator; + itemCount: number; + renderPage: (index: number) => SlideItem; + batchCount: number; + onPageSlided?: (index: number) => void; + loop?: boolean; + scrollable?: boolean; + /** + * Take effect only on iOS + */ + bounces?: boolean; + slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise; + getSlidedPage(context: BridgeContext): Promise; } export function slider(config: Partial): Slider; export function slideItem(item: View | View[], config?: Partial): SlideItem; @@ -673,6 +679,9 @@ declare module 'doric/lib/src/widget/scroller' { y: number; }) => void; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; allSubviews(): View[]; toModel(): NativeViewModel; @@ -714,34 +723,37 @@ declare module 'doric/lib/src/widget/flowlayout' { import { Stack } from 'doric/lib/src/widget/layouts'; import { Superview, View, NativeViewModel } from 'doric/lib/src/ui/view'; export class FlowLayoutItem extends Stack { - /** - * Set to reuse native view - */ - identifier?: string; + /** + * Set to reuse native view + */ + identifier?: string; } export class FlowLayout extends Superview { - allSubviews(): IterableIterator | FlowLayoutItem[]; - columnCount: number; - columnSpace?: number; - rowSpace?: number; - itemCount: number; - renderItem: (index: number) => FlowLayoutItem; - batchCount: number; - onLoadMore?: () => void; - loadMore?: boolean; - loadMoreView?: FlowLayoutItem; - onScroll?: (offset: { - x: number; - y: number; - }) => void; - onScrollEnd?: (offset: { - x: number; - y: number; - }) => void; - scrollable?: boolean; - bounces?: boolean; - reset(): void; - toModel(): NativeViewModel; + allSubviews(): IterableIterator | FlowLayoutItem[]; + columnCount: number; + columnSpace?: number; + rowSpace?: number; + itemCount: number; + renderItem: (index: number) => FlowLayoutItem; + batchCount: number; + onLoadMore?: () => void; + loadMore?: boolean; + loadMoreView?: FlowLayoutItem; + onScroll?: (offset: { + x: number; + y: number; + }) => void; + onScrollEnd?: (offset: { + x: number; + y: number; + }) => void; + scrollable?: boolean; + /** + * Take effect only on iOS + */ + bounces?: boolean; + reset(): void; + toModel(): NativeViewModel; } export function flowlayout(config: Partial): FlowLayout; export function flowItem(item: View | View[], config?: Partial): FlowLayoutItem; @@ -786,6 +798,9 @@ declare module 'doric/lib/src/widget/nestedSlider' { export class NestedSlider extends Group { onPageSlided?: (index: number) => void; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; addSlideItem(view: View): void; slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise; diff --git a/doric-js/lib/src/widget/flowlayout.d.ts b/doric-js/lib/src/widget/flowlayout.d.ts index 23eefba9..a4dcb971 100644 --- a/doric-js/lib/src/widget/flowlayout.d.ts +++ b/doric-js/lib/src/widget/flowlayout.d.ts @@ -27,6 +27,9 @@ export declare class FlowLayout extends Superview { y: number; }) => void; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; reset(): void; private getItem; diff --git a/doric-js/lib/src/widget/list.d.ts b/doric-js/lib/src/widget/list.d.ts index f8491507..fcdc0e0a 100644 --- a/doric-js/lib/src/widget/list.d.ts +++ b/doric-js/lib/src/widget/list.d.ts @@ -32,6 +32,9 @@ export declare class List extends Superview { }) => void; scrolledPosition?: number; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean; diff --git a/doric-js/lib/src/widget/nestedSlider.d.ts b/doric-js/lib/src/widget/nestedSlider.d.ts index 45c40f22..f0ddb164 100644 --- a/doric-js/lib/src/widget/nestedSlider.d.ts +++ b/doric-js/lib/src/widget/nestedSlider.d.ts @@ -3,6 +3,9 @@ import { BridgeContext } from '../runtime/global'; export declare class NestedSlider extends Group { onPageSlided?: (index: number) => void; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; addSlideItem(view: View): void; slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise; diff --git a/doric-js/lib/src/widget/scroller.d.ts b/doric-js/lib/src/widget/scroller.d.ts index 50ae7756..89d3b2a1 100644 --- a/doric-js/lib/src/widget/scroller.d.ts +++ b/doric-js/lib/src/widget/scroller.d.ts @@ -16,6 +16,9 @@ export declare class Scroller extends Superview { y: number; }) => void; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; allSubviews(): View[]; toModel(): NativeViewModel; diff --git a/doric-js/lib/src/widget/slider.d.ts b/doric-js/lib/src/widget/slider.d.ts index 77136dbd..35b590df 100644 --- a/doric-js/lib/src/widget/slider.d.ts +++ b/doric-js/lib/src/widget/slider.d.ts @@ -16,6 +16,9 @@ export declare class Slider extends Superview { onPageSlided?: (index: number) => void; loop?: boolean; scrollable?: boolean; + /** + * Take effect only on iOS + */ bounces?: boolean; private getItem; private renderBunchedItems; diff --git a/doric-js/src/widget/flowlayout.ts b/doric-js/src/widget/flowlayout.ts index 82ef2552..bec264f4 100644 --- a/doric-js/src/widget/flowlayout.ts +++ b/doric-js/src/widget/flowlayout.ts @@ -71,7 +71,9 @@ export class FlowLayout extends Superview { @Property scrollable?: boolean - + /** + * Take effect only on iOS + */ @Property bounces?: boolean diff --git a/doric-js/src/widget/list.ts b/doric-js/src/widget/list.ts index 4ad151df..03884868 100644 --- a/doric-js/src/widget/list.ts +++ b/doric-js/src/widget/list.ts @@ -75,7 +75,9 @@ export class List extends Superview { @Property scrollable?: boolean - + /** + * Take effect only on iOS + */ @Property bounces?: boolean diff --git a/doric-js/src/widget/nestedSlider.ts b/doric-js/src/widget/nestedSlider.ts index 0263fbb3..ec259880 100644 --- a/doric-js/src/widget/nestedSlider.ts +++ b/doric-js/src/widget/nestedSlider.ts @@ -23,7 +23,9 @@ export class NestedSlider extends Group { @Property scrollable?: boolean - + /** + * Take effect only on iOS + */ @Property bounces?: boolean diff --git a/doric-js/src/widget/scroller.ts b/doric-js/src/widget/scroller.ts index 8916f5ef..63b819e1 100644 --- a/doric-js/src/widget/scroller.ts +++ b/doric-js/src/widget/scroller.ts @@ -44,7 +44,9 @@ export class Scroller extends Superview { @Property scrollable?: boolean - + /** + * Take effect only on iOS + */ @Property bounces?: boolean diff --git a/doric-js/src/widget/slider.ts b/doric-js/src/widget/slider.ts index c9d0144c..4f273aaa 100644 --- a/doric-js/src/widget/slider.ts +++ b/doric-js/src/widget/slider.ts @@ -51,7 +51,9 @@ export class Slider extends Superview { @Property scrollable?: boolean - + /** + * Take effect only on iOS + */ @Property bounces?: boolean