@aryagg/types
v1.1.3
Published
Shared TypeScript types and constants for aryagg packages
Downloads
622
Readme
@aryagg/types
Shared TypeScript types and constants for aryagg packages. Framework-agnostic — works with any TypeScript project.
Installation
npm install @aryagg/typesAPI Types
API & HTTP
import type { IApiResult, IApiResponse, IAPIQueuePayload } from '@aryagg/types';
import { HttpMethod } from '@aryagg/types';
const result: IApiResult<User> = {
status: true,
message: 'OK',
result: { id: 1, name: 'Alice' },
};
const response: IApiResponse<User[]> = {
isSuccess: true,
message: 'Fetched',
data: [],
};
const payload: IAPIQueuePayload = {
url: '/api/users',
method: HttpMethod.POST,
data: { name: 'Alice' },
};UI Components
import type { IToast, ISnackData, ITab, TableColumn, IGenericObject } from '@aryagg/types';
import { ESnackType } from '@aryagg/types';
const toast: IToast = { id: 1, message: 'Saved!', type: ESnackType.SUCCESS };
const tab: ITab = {
id: 'home',
label: 'Home',
badge: 3,
disabled: false,
};
const column: TableColumn = {
key: 'name',
label: 'Full Name',
sortable: true,
};Enums
import { ESnackType, ETheme, ELocale } from '@aryagg/types';
ESnackType.SUCCESS // 'success'
ESnackType.DANGER // 'danger'
ESnackType.WARNING // 'warning'
ESnackType.INFO // 'info'
ETheme.LIGHT // 'light'
ETheme.DARK // 'dark'
ELocale.EN // 'en'
ELocale.ES // 'es'
ELocale.AR // 'ar'Auth
import type { IUser, IAuthState } from '@aryagg/types';Layout
import type { IMenuItem, ISidebarState } from '@aryagg/types';Storage
import type { IStorageItem } from '@aryagg/types';Settings
import type { IAppSettings } from '@aryagg/types';Input & Forms
import type { IInputOption } from '@aryagg/types';
import { EInputType, EDataType } from '@aryagg/types';Date Picker
import type { IDatePickerProps } from '@aryagg/types';Source
github.com/iron-throne/skeleton-packages/tree/main/packages/types
