Skip to content

Commit 3bda52e

Browse files
committed
jsdoc
1 parent 2db26c8 commit 3bda52e

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

x-pack/plugins/licensing/server/services/feature_usage_service.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,29 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
/** @public */
78
export interface FeatureUsageServiceSetup {
9+
/**
10+
* Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}.
11+
*/
812
register(featureName: string): void;
913
}
14+
15+
/** @public */
1016
export interface FeatureUsageServiceStart {
17+
/**
18+
* Notify of a registered feature usage at given time.
19+
* If `usedAt` is not specified, it will use the current time instead.
20+
*/
1121
notifyUsage(featureName: string, usedAt?: number): void;
22+
/**
23+
* Return a map containing last usage timestamp for all features.
24+
* Features that were not used yet do not appear in the map.
25+
*/
1226
getLastUsages(): ReadonlyMap<string, number>;
27+
/**
28+
* Clear all usage records from the service.
29+
*/
1330
clear(): void;
1431
}
1532

x-pack/plugins/licensing/server/types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export interface LicensingPluginSetup {
5858
* Triggers licensing information re-fetch.
5959
*/
6060
refresh(): Promise<ILicense>;
61-
6261
/**
6362
* Creates a license poller to retrieve a license data with.
6463
* Allows a plugin to configure a cluster to retrieve data from at
@@ -68,17 +67,16 @@ export interface LicensingPluginSetup {
6867
clusterClient: IClusterClient,
6968
pollingFrequency: number
7069
) => { license$: Observable<ILicense>; refresh(): Promise<ILicense> };
71-
7270
/**
73-
* TODO
71+
* APIs to register licensed feature usage.
7472
*/
7573
featureUsage: FeatureUsageServiceSetup;
7674
}
7775

7876
/** @public */
7977
export interface LicensingPluginStart {
8078
/**
81-
* TODO
79+
* APIs to manage licensed feature usage.
8280
*/
8381
featureUsage: FeatureUsageServiceStart;
8482
}

0 commit comments

Comments
 (0)