Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ningacoding committed Aug 14, 2024
1 parent cc4e05c commit f3f48ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
32 changes: 20 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {ListRenderItem} from 'react-native';
import * as React from 'react';

declare module 'klazify' {

import {StyleProp, ViewStyle} from 'react-native';
// @ts-ignore
import Color = require('color');

/**
* This method must be run before css() method.
* @param opts
Expand Down Expand Up @@ -277,7 +277,7 @@ declare module 'klazify' {
},
logs?: boolean,
});

/**
* Applies all rules for StyleSheets (from react-native)
* and EStyleSheets (from react-native-extended-stylesheet)
Expand All @@ -286,15 +286,15 @@ declare module 'klazify' {
* @private
*/
function css(styles: string | object);

/**
* Returns a variable value.
* Remember to run init() method at app startup.
* @param variableName
* @private
*/
function value(variableName: string): any;

/**
* Returns a color value.
* Check npm package 'color' for more info.
Expand All @@ -303,7 +303,7 @@ declare module 'klazify' {
* @private
*/
function color(variableName: string): Color<any>;

/**
* Component that shows a popup layout.
* Remember to run init() method at app startup.
Expand All @@ -315,16 +315,24 @@ declare module 'klazify' {
contentStyle?: StyleProp<ViewStyle> | undefined;
popupStyle?: StyleProp<ViewStyle> | undefined;
}

/**
* Component with useful selector with animation.
* Remember to run init() method at app startup.
*/
interface RenderItemType<ItemT> {
item: ItemT,
index: number,
isSelected: boolean,
isLast: boolean,
isFirst: boolean,
}

interface HorizontalSelectorProps<ItemT> {
data: any[];
initialIndex?: number;
extraData?: any;
renderItem?: ListRenderItem<ItemT> | null | undefined;
renderItem?: RenderItemType<ItemT>;
renderIndicator?: ListRenderItem<ItemT> | null | undefined;
itemStyle?: StyleProp<ViewStyle> | undefined;
containerStyle?: StyleProp<ViewStyle> | undefined;
Expand All @@ -338,17 +346,17 @@ declare module 'klazify' {
onItemSelected?: ({item: any, index: number}) => void;
onItemUnselected?: ({item: any, index: number}) => void;
}

// noinspection JSUnusedGlobalSymbols
class Popover extends React.Component<PopoverProps> {
}

// noinspection JSUnusedGlobalSymbols
class HorizontalSelector extends React.Component<HorizontalSelectorProps<any>, any> {
}

export {init, css, color, value, Popover, HorizontalSelector};

}

type NotDefault<T> = T extends 'default' ? never : T;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "klazify",
"version": "1.1.5-beta1d",
"version": "1.1.6",
"description": "Fast, Reusable, React Native stylesheets classes.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f3f48ee

Please sign in to comment.