mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-23 20:26:28 +00:00
17 lines
477 B
TypeScript
17 lines
477 B
TypeScript
|
export interface IMessageIdProvider {
|
||
|
allocate(): number | null;
|
||
|
getLastAllocated(): number | null;
|
||
|
register(num: number): boolean;
|
||
|
deallocate(num: number): void;
|
||
|
clear(): void;
|
||
|
}
|
||
|
export default class DefaultMessageIdProvider implements IMessageIdProvider {
|
||
|
private nextId;
|
||
|
constructor();
|
||
|
allocate(): number;
|
||
|
getLastAllocated(): number;
|
||
|
register(messageId: number): boolean;
|
||
|
deallocate(messageId: number): void;
|
||
|
clear(): void;
|
||
|
}
|