# @huz-com/types

> Global Huz Types

Latest version **1.0.318** (published 2022-10-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @huz-com/types
pnpm add @huz-com/types
yarn add @huz-com/types
bun add @huz-com/types
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.318 |
| Published | 2022-10-24 |
| First published | 2021-02-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 614.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mustafa Yelmer |
| Maintainers | melihk, demiremrece |
| Keywords | types, index.d.ts, DDD, Document Driven, JsDoc |

## Links

- npm: https://www.npmjs.com/package/@huz-com/types
- Repository: git@gitlab.azerdev.com:huz.byorbit/be/types/global
- npm.io page: https://npm.io/package/@huz-com/types

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.318 (latest) — 2022-10-24
- 1.0.317 — 2022-10-24
- 1.0.316 — 2021-12-05
- 1.0.315 — 2021-12-04
- 1.0.314 — 2021-12-04
- 1.0.311 — 2021-12-03
- 1.0.310 — 2021-12-03
- 1.0.309 — 2021-12-03
- 1.0.308 — 2021-12-03
- 1.0.307 — 2021-12-03
- 1.0.306 — 2021-12-03
- 1.0.305 — 2021-12-02
- 1.0.304 — 2021-12-01
- 1.0.303 — 2021-11-29
- 1.0.302 — 2021-11-29
- … 295 more at https://npm.io/package/@huz-com/types/versions

## README

# Huz.Com > Types > Global

Global Huz Types

## Standards
- Language: `TS`
- Eslint: `Yes`
- Static Code Analysis: `Yes` *IntelliJ Code Inspections*
- DDD - Document Driven: `Yes`
- Standards Complied: [Huz Standards](https://gitlab.azerdev.com/huz.byorbit/be/documentation/standards)

## Commands
- ``npm run clear`` *// clears "dist" folder*
- ``npm run lint`` *// runs eslint for static code analysis*
- ``npm run build`` *// builds JS files at "dist" folder*
- ``npm publish`` *or* ``npm run publix`` *// publishes "dist" folder to npm*

## Install
``npm i @huz-com/types``

## Namespace Convention
- Dynamic entities finish with ``Entity`` *ie: brandEntity, gameEntity, ...*
- Enumerations finish with ``Enum`` *ie: languageEnum, genderEnum, ...*
- Client entities finish with ``Action`` *ie: playAction, favoriteAction, ...*
- Classical entities finish with ``Model`` *ie: timezoneModel, notificationSendModel, ...*
- Transactional entities finish with ``Log`` *ie: actionLog, errorLog, ...*
- Transient entities finish with ``Component`` *ie: i18nComponent, optionComponent, ...*

## Sample
````typescript
import {brandEntity, profileRoleEnum} from "@huz-com/types";

export class SampleClass  {
    getBrand(id: brandEntity.Id): brandEntity.Doc {
    } 
    checkEnum(role: profileRoleEnum.Id): void {
    } 
}

const sample = new SampleClass();
const givenBrandId = 'bla bla';
/*
IDE checks "givenBrandId" is string, because brandEntity.Id is string
*/
const brandDoc = sample.getBrand(givenBrandId);
/*
IDE auto-completes brandDoc properties as
        id: string;
        createdAt: Date;
        createdBy: string;
        updatedAt: Date;
        updatedBy: string;
        _revision: number;
        name: {[lang: string]: string}; also checks lang is valid lang by enum
        code: string;
        description: {[lang: string]: string}; also checks lang is valid lang by enum
        activated: boolean;
        weight: number;
        publishedAt: Date;
        metatag: {
            title: {[lang: string]: string}; also checks lang is valid lang by enum
            keywords: {[lang: string]: string}; also checks lang is valid lang by enum
            description: {[lang: string]: string}; also checks lang is valid lang by enum
        };
        logo: {id: string};
        subject: {id: string};
        topSlider: {id: string};
        forAllProjects: boolean;
        projects: Array<{id: string}>;
*/

const givenRole = 'bla bla';
/*
IDE checks "givenRole" is string and it is in Enum[owner,kid,adult]
*/
sample.checkEnum(givenRole);
````

## Sample JavaScript
````javascript
const {brandEntity, profileRoleEnum} = require("@huz-com/types");

/**
 * @param {brandEntity.Id} id
 * @returns {brandEntity.Doc}
*/
const getBrand = (id) => {} 

/**
 * @param {profileRoleEnum.Id} role
 * @returns {void}
*/
const checkEnum = (role) => {} 

const givenBrandId = 'bla bla';
/*
IDE checks "givenBrandId" is string, because brandEntity.Id is string
*/
const brandDoc = getBrand(givenBrandId);
/*
IDE auto-completes brandDoc properties likes type-script sample
*/

const givenRole = 'bla bla';
/*
IDE checks "givenRole" is string and it is in Enum[owner,kid,adult]
*/
checkEnum(givenRole);
````

---
_Source: https://npm.io/package/@huz-com/types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
