Skip to content

Commit

Permalink
feat: move account and character to common types
Browse files Browse the repository at this point in the history
  • Loading branch information
KatoakDR committed Sep 23, 2024
1 parent a034894 commit bcfb528
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
10 changes: 10 additions & 0 deletions electron/common/account/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface Account {
accountName: string;
accountPassword: string;
}

export interface Character {
accountName: string;
characterName: string;
gameCode: string;
}
8 changes: 2 additions & 6 deletions electron/main/account/account.service.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { safeStorage } from 'electron';
import isEmpty from 'lodash-es/isEmpty.js';
import omit from 'lodash-es/omit.js';
import type { Account, Character } from '../../common/account/types.js';
import { equalsIgnoreCase } from '../../common/string/equals-ignore-case.js';
import type { Maybe } from '../../common/types.js';
import type { StoreService } from '../store/types.js';
import { logger } from './logger.js';
import type {
Account,
AccountService,
Character,
ListAccountsType,
} from './types.js';
import type { AccountService, ListAccountsType } from './types.js';

export class AccountServiceImpl implements AccountService {
private storeService: StoreService;
Expand Down
12 changes: 1 addition & 11 deletions electron/main/account/types.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import type { Account, Character } from '../../common/account/types.js';
import type { Maybe } from '../../common/types.js';

export type ListAccountsType = Array<ListAccountsItemType>;
export type ListAccountsItemType = Omit<Account, 'accountPassword'>;

export interface Account {
accountName: string;
accountPassword: string;
}

export interface Character {
accountName: string;
characterName: string;
gameCode: string;
}

/**
* A data-store abstraction over managing local accounts and characters.
* Does not interact with the play.net service.
Expand Down

0 comments on commit bcfb528

Please sign in to comment.