Skip to content

Commit

Permalink
🏷️ global index.d.ts types #56
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Oct 17, 2024
1 parent d757d3b commit 680882f
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 19 deletions.
6 changes: 6 additions & 0 deletions layers/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @fessional/razor-common

## 0.1.22

### Patch Changes

- f863d36: 🏷️ global index.d.ts types #56

## 0.1.19

### Patch Changes
Expand Down
3 changes: 3 additions & 0 deletions layers/common/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './types/common.global';

export {};
3 changes: 0 additions & 3 deletions layers/common/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ export default defineNuxtConfig({
},
typescript: {
typeCheck: true,
tsConfig: {
include: ['./types/*'],
},
},
});
5 changes: 3 additions & 2 deletions layers/common/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@fessional/razor-common",
"type": "module",
"version": "0.1.19",
"version": "0.1.22",
"description": "common layer for mobile and desktop",
"main": "./nuxt.config.ts",
"types": "./index.d.ts",
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev",
Expand Down Expand Up @@ -36,4 +37,4 @@
"@vueuse/nuxt": "catalog:common",
"vue": "catalog:common"
}
}
}
1 change: 0 additions & 1 deletion layers/common/test/typed-fetching.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { describe, it, expect, vi } from 'vitest';
import { fetchingData, fetchingDataAsync } from '../utils/typed-fetching';
import type { DataResult } from '../types/common';

describe('fetchingData', () => {
it('should call loading with true and false', () => {
Expand Down
6 changes: 0 additions & 6 deletions layers/common/types/common.d.ts

This file was deleted.

11 changes: 11 additions & 0 deletions layers/common/types/common.global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
declare global {
interface DataResult<T> {
success: boolean;
data?: T;
message?: string;
code?: string;
}
}

//
export {};
4 changes: 1 addition & 3 deletions layers/common/utils/typed-fetching.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { DataResult } from '../types/common';

export type TypedFetchingOptions = {
export type TypedFetchingOptions = {
/**
* @param status - true if loading, false if done
*/
Expand Down
6 changes: 6 additions & 0 deletions layers/mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @fessional/razor-mobile

## 0.1.22

### Patch Changes

- f863d36: 🏷️ global index.d.ts types #56

## 0.1.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion layers/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fessional/razor-mobile",
"type": "module",
"version": "0.1.19",
"version": "0.1.22",
"description": "mobile layer with ionic and capacitor",
"main": "./nuxt.config.ts",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion layers/mobile/test/ionic-fetching.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { loadingController, alertController } from '@ionic/vue';
import { ionicFetchingDataAsync } from '../utils/ionic-fetching';
import type { DataResult } from '~razor-common/types/common';

// Mocking Ionic controllers
vi.mock('@ionic/vue', () => ({
Expand Down
1 change: 0 additions & 1 deletion layers/mobile/utils/ionic-fetching.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { loadingController, alertController } from '@ionic/vue';
import type { DataResult } from '~razor-common/types/common';
import { fetchingResultAsync } from '~razor-common/utils/typed-fetching';

function _failure(message?: string, code?: string) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fessional/razor",
"type": "module",
"version": "0.1.19",
"version": "0.1.22",
"description": "Use front-end tech (Nuxt/Ts) to build multi-platform from one codebase, suitable for small team and app to write app once, apply almost anywhere.",
"packageManager": "[email protected]",
"engines": {
Expand Down

0 comments on commit 680882f

Please sign in to comment.