0.6.4 • Published 8 days ago

@salesduck/kkmserver-types v0.6.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 days ago

kkmserver-types

Define types for kkmserver.ru

Setup

Add to your project

yarn add -D @salesduck/kkmserver-types

Usage

// 1. Import types
import type { CloseShiftCommandRequest, CloseShiftCommandResponse } from '@salesduck/kkmserver-types';

// 2. Define method using types
const closeShift = async (CashierName: string, CashierVATIN: string): Promise<CloseShiftCommandResponse> => {
    const command: CloseShiftCommandRequest = {
        Command: 'CloseShift',
        NumDevice: 1,
        CashierName,
        CashierVATIN
    };

    const response = await fetch('kkmserver:port/Execute', { body: JSON.stringify(command) });
    const json = await response.json();

    return json;
};

// 3. Use type-safe method
closeShift('Cashier Name', '430601071197').then(console.log).catch(console.error);

TODO

  1. Write tests
  2. Not all methods have types
0.6.4

8 days ago

0.6.3

4 months ago

0.6.2

4 months ago

0.6.1

4 months ago

0.3.0

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.4.4

4 months ago

0.5.0

4 months ago

0.4.1

4 months ago

0.4.0

4 months ago

0.3.1

4 months ago

0.6.0

4 months ago

0.4.2

4 months ago

0.1.1

5 months ago

0.1.0

5 months ago