161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci* Copyright (C) 2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci* you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci* You may obtain a copy of the License at
661847f8eSopenharmony_ci*
761847f8eSopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci*
961847f8eSopenharmony_ci* Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci* See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci* limitations under the License.
1461847f8eSopenharmony_ci*/
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file Defines the DRM capability.
1861847f8eSopenharmony_ci * @kit DrmKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ci/**
2261847f8eSopenharmony_ci * This module provides the DRM capability to multimedia player.
2361847f8eSopenharmony_ci * @namespace drm
2461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Drm.Core
2561847f8eSopenharmony_ci * @since 11
2661847f8eSopenharmony_ci */
2761847f8eSopenharmony_ci/**
2861847f8eSopenharmony_ci * This module provides the DRM capability to multimedia player.
2961847f8eSopenharmony_ci * @namespace drm
3061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Drm.Core
3161847f8eSopenharmony_ci * @atomicservice
3261847f8eSopenharmony_ci * @since 12
3361847f8eSopenharmony_ci */
3461847f8eSopenharmony_cideclare namespace drm {
3561847f8eSopenharmony_ci/**
3661847f8eSopenharmony_ci * Enumerates drm error code.
3761847f8eSopenharmony_ci * @enum { number }
3861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Drm.Core
3961847f8eSopenharmony_ci * @since 11
4061847f8eSopenharmony_ci */
4161847f8eSopenharmony_ci  enum DrmErrorCode {
4261847f8eSopenharmony_ci    /**
4361847f8eSopenharmony_ci     * All unknown errors.
4461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
4561847f8eSopenharmony_ci     * @since 11
4661847f8eSopenharmony_ci     */
4761847f8eSopenharmony_ci    ERROR_UNKNOWN = 24700101,
4861847f8eSopenharmony_ci    /**
4961847f8eSopenharmony_ci     * Meet max MediaKeySystem num limit.
5061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
5161847f8eSopenharmony_ci     * @since 11
5261847f8eSopenharmony_ci     */
5361847f8eSopenharmony_ci    MAX_SYSTEM_NUM_REACHED = 24700103,
5461847f8eSopenharmony_ci    /**
5561847f8eSopenharmony_ci     * Meet max MediaKeySession num limit.
5661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
5761847f8eSopenharmony_ci     * @since 11
5861847f8eSopenharmony_ci     */
5961847f8eSopenharmony_ci    MAX_SESSION_NUM_REACHED = 24700104,
6061847f8eSopenharmony_ci    /**
6161847f8eSopenharmony_ci     * Fatal service error, for example, service died.
6261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
6361847f8eSopenharmony_ci     * @since 11
6461847f8eSopenharmony_ci     */
6561847f8eSopenharmony_ci    SERVICE_FATAL_ERROR = 24700201
6661847f8eSopenharmony_ci  }
6761847f8eSopenharmony_ci
6861847f8eSopenharmony_ci  /**
6961847f8eSopenharmony_ci   * Enumerates which config name we can get.
7061847f8eSopenharmony_ci   * @enum { string }
7161847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
7261847f8eSopenharmony_ci   * @since 11
7361847f8eSopenharmony_ci   */
7461847f8eSopenharmony_ci  enum PreDefinedConfigName {
7561847f8eSopenharmony_ci    /**
7661847f8eSopenharmony_ci     * Config name vendor
7761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
7861847f8eSopenharmony_ci     * @since 11
7961847f8eSopenharmony_ci     */
8061847f8eSopenharmony_ci    CONFIG_DEVICE_VENDOR = 'vendor',
8161847f8eSopenharmony_ci    /**
8261847f8eSopenharmony_ci     * Config name version
8361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
8461847f8eSopenharmony_ci     * @since 11
8561847f8eSopenharmony_ci     */
8661847f8eSopenharmony_ci    CONFIG_DEVICE_VERSION = 'version',
8761847f8eSopenharmony_ci    /**
8861847f8eSopenharmony_ci     * Config name description
8961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
9061847f8eSopenharmony_ci     * @since 11
9161847f8eSopenharmony_ci     */
9261847f8eSopenharmony_ci    CONFIG_DEVICE_DESCRIPTION = 'description',
9361847f8eSopenharmony_ci    /**
9461847f8eSopenharmony_ci     * Config name algorithms
9561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
9661847f8eSopenharmony_ci     * @since 11
9761847f8eSopenharmony_ci     */
9861847f8eSopenharmony_ci    CONFIG_DEVICE_ALGORITHMS = 'algorithms',
9961847f8eSopenharmony_ci    /**
10061847f8eSopenharmony_ci     * Config name deviceUniqueId
10161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
10261847f8eSopenharmony_ci     * @since 11
10361847f8eSopenharmony_ci     */
10461847f8eSopenharmony_ci    CONFIG_DEVICE_UNIQUE_ID = 'deviceUniqueId',
10561847f8eSopenharmony_ci    /**
10661847f8eSopenharmony_ci     * Config name maxSessionNum
10761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
10861847f8eSopenharmony_ci     * @since 11
10961847f8eSopenharmony_ci     */
11061847f8eSopenharmony_ci    CONFIG_SESSION_MAX = 'maxSessionNum',
11161847f8eSopenharmony_ci    /**
11261847f8eSopenharmony_ci     * Config name currentSessionNum
11361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
11461847f8eSopenharmony_ci     * @since 11
11561847f8eSopenharmony_ci     */
11661847f8eSopenharmony_ci    CONFIG_SESSION_CURRENT = 'currentSessionNum',
11761847f8eSopenharmony_ci  }
11861847f8eSopenharmony_ci
11961847f8eSopenharmony_ci  /**
12061847f8eSopenharmony_ci   * Enumerates media key type.
12161847f8eSopenharmony_ci   * @enum { number }
12261847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
12361847f8eSopenharmony_ci   * @since 11
12461847f8eSopenharmony_ci   */
12561847f8eSopenharmony_ci  enum MediaKeyType {
12661847f8eSopenharmony_ci    /**
12761847f8eSopenharmony_ci     * Offline media key type.
12861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
12961847f8eSopenharmony_ci     * @since 11
13061847f8eSopenharmony_ci     */
13161847f8eSopenharmony_ci    MEDIA_KEY_TYPE_OFFLINE = 0,
13261847f8eSopenharmony_ci    /**
13361847f8eSopenharmony_ci     * Online media key type.
13461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
13561847f8eSopenharmony_ci     * @since 11
13661847f8eSopenharmony_ci     */
13761847f8eSopenharmony_ci    MEDIA_KEY_TYPE_ONLINE,
13861847f8eSopenharmony_ci  }
13961847f8eSopenharmony_ci
14061847f8eSopenharmony_ci  /**
14161847f8eSopenharmony_ci   * Enumerates offline media key status.
14261847f8eSopenharmony_ci   * @enum { number }
14361847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
14461847f8eSopenharmony_ci   * @since 11
14561847f8eSopenharmony_ci   */
14661847f8eSopenharmony_ci  enum OfflineMediaKeyStatus {
14761847f8eSopenharmony_ci    /**
14861847f8eSopenharmony_ci     * Offline media key status unknown.
14961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
15061847f8eSopenharmony_ci     * @since 11
15161847f8eSopenharmony_ci     */
15261847f8eSopenharmony_ci    OFFLINE_MEDIA_KEY_STATUS_UNKNOWN = 0,
15361847f8eSopenharmony_ci    /**
15461847f8eSopenharmony_ci     * Offline media key status usable.
15561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
15661847f8eSopenharmony_ci     * @since 11
15761847f8eSopenharmony_ci     */
15861847f8eSopenharmony_ci    OFFLINE_MEDIA_KEY_STATUS_USABLE = 1,
15961847f8eSopenharmony_ci    /**
16061847f8eSopenharmony_ci     * Offline media key status inactive.
16161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
16261847f8eSopenharmony_ci     * @since 11
16361847f8eSopenharmony_ci     */
16461847f8eSopenharmony_ci    OFFLINE_MEDIA_KEY_STATUS_INACTIVE = 2,
16561847f8eSopenharmony_ci  }
16661847f8eSopenharmony_ci
16761847f8eSopenharmony_ci  /**
16861847f8eSopenharmony_ci   * Enumerates certificate status.
16961847f8eSopenharmony_ci   * @enum { number }
17061847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
17161847f8eSopenharmony_ci   * @since 11
17261847f8eSopenharmony_ci   */
17361847f8eSopenharmony_ci  enum CertificateStatus {
17461847f8eSopenharmony_ci    /**
17561847f8eSopenharmony_ci     * Device already provisioned.
17661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
17761847f8eSopenharmony_ci     * @since 11
17861847f8eSopenharmony_ci     */
17961847f8eSopenharmony_ci    CERT_STATUS_PROVISIONED = 0,
18061847f8eSopenharmony_ci    /**
18161847f8eSopenharmony_ci     * Device not provisioned.
18261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
18361847f8eSopenharmony_ci     * @since 11
18461847f8eSopenharmony_ci     */
18561847f8eSopenharmony_ci    CERT_STATUS_NOT_PROVISIONED,
18661847f8eSopenharmony_ci    /**
18761847f8eSopenharmony_ci     * Cert already expired.
18861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
18961847f8eSopenharmony_ci     * @since 11
19061847f8eSopenharmony_ci     */
19161847f8eSopenharmony_ci    CERT_STATUS_EXPIRED,
19261847f8eSopenharmony_ci    /**
19361847f8eSopenharmony_ci     * Certs are invalid.
19461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
19561847f8eSopenharmony_ci     * @since 11
19661847f8eSopenharmony_ci     */
19761847f8eSopenharmony_ci    CERT_STATUS_INVALID,
19861847f8eSopenharmony_ci    /**
19961847f8eSopenharmony_ci     * Get certs status failed.
20061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
20161847f8eSopenharmony_ci     * @since 11
20261847f8eSopenharmony_ci     */
20361847f8eSopenharmony_ci    CERT_STATUS_UNAVAILABLE,
20461847f8eSopenharmony_ci  }
20561847f8eSopenharmony_ci
20661847f8eSopenharmony_ci  /**
20761847f8eSopenharmony_ci   * Enumerates media key request types.
20861847f8eSopenharmony_ci   * @enum { number }
20961847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
21061847f8eSopenharmony_ci   * @since 11
21161847f8eSopenharmony_ci   */
21261847f8eSopenharmony_ci  /**
21361847f8eSopenharmony_ci   * Enumerates media key request types.
21461847f8eSopenharmony_ci   * @enum { number }
21561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
21661847f8eSopenharmony_ci   * @atomicservice
21761847f8eSopenharmony_ci   * @since 12
21861847f8eSopenharmony_ci   */
21961847f8eSopenharmony_ci  enum MediaKeyRequestType {
22061847f8eSopenharmony_ci    /**
22161847f8eSopenharmony_ci     * Media key request type unknown.
22261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
22361847f8eSopenharmony_ci     * @since 11
22461847f8eSopenharmony_ci     */
22561847f8eSopenharmony_ci    /**
22661847f8eSopenharmony_ci     * Media key request type unknown.
22761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
22861847f8eSopenharmony_ci     * @atomicservice
22961847f8eSopenharmony_ci     * @since 12
23061847f8eSopenharmony_ci     */
23161847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_UNKNOWN = 0,
23261847f8eSopenharmony_ci    /**
23361847f8eSopenharmony_ci     * Media key request type initial.
23461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
23561847f8eSopenharmony_ci     * @since 11
23661847f8eSopenharmony_ci     */
23761847f8eSopenharmony_ci    /**
23861847f8eSopenharmony_ci     * Media key request type initial.
23961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
24061847f8eSopenharmony_ci     * @atomicservice
24161847f8eSopenharmony_ci     * @since 12
24261847f8eSopenharmony_ci     */
24361847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_INITIAL = 1,
24461847f8eSopenharmony_ci    /**
24561847f8eSopenharmony_ci     * Media key request type renewal.
24661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
24761847f8eSopenharmony_ci     * @since 11
24861847f8eSopenharmony_ci     */
24961847f8eSopenharmony_ci    /**
25061847f8eSopenharmony_ci     * Media key request type renewal.
25161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
25261847f8eSopenharmony_ci     * @atomicservice
25361847f8eSopenharmony_ci     * @since 12
25461847f8eSopenharmony_ci     */
25561847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_RENEWAL = 2,
25661847f8eSopenharmony_ci    /**
25761847f8eSopenharmony_ci     * Media key request type release.
25861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
25961847f8eSopenharmony_ci     * @since 11
26061847f8eSopenharmony_ci     */
26161847f8eSopenharmony_ci    /**
26261847f8eSopenharmony_ci     * Media key request type release.
26361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
26461847f8eSopenharmony_ci     * @atomicservice
26561847f8eSopenharmony_ci     * @since 12
26661847f8eSopenharmony_ci     */
26761847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_RELEASE = 3,
26861847f8eSopenharmony_ci    /**
26961847f8eSopenharmony_ci     * Media key request type none.
27061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
27161847f8eSopenharmony_ci     * @since 11
27261847f8eSopenharmony_ci     */
27361847f8eSopenharmony_ci    /**
27461847f8eSopenharmony_ci     * Media key request type none.
27561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
27661847f8eSopenharmony_ci     * @atomicservice
27761847f8eSopenharmony_ci     * @since 12
27861847f8eSopenharmony_ci     */
27961847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_NONE = 4,
28061847f8eSopenharmony_ci    /**
28161847f8eSopenharmony_ci     * Media key request type update.
28261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
28361847f8eSopenharmony_ci     * @since 11
28461847f8eSopenharmony_ci     */
28561847f8eSopenharmony_ci    /**
28661847f8eSopenharmony_ci     * Media key request type update.
28761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
28861847f8eSopenharmony_ci     * @atomicservice
28961847f8eSopenharmony_ci     * @since 12
29061847f8eSopenharmony_ci     */
29161847f8eSopenharmony_ci    MEDIA_KEY_REQUEST_TYPE_UPDATE = 5,
29261847f8eSopenharmony_ci  }
29361847f8eSopenharmony_ci
29461847f8eSopenharmony_ci  /**
29561847f8eSopenharmony_ci   * Enumerates content protection level.
29661847f8eSopenharmony_ci   * @enum { number }
29761847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
29861847f8eSopenharmony_ci   * @since 11
29961847f8eSopenharmony_ci   */
30061847f8eSopenharmony_ci  /**
30161847f8eSopenharmony_ci   * Enumerates content protection level.
30261847f8eSopenharmony_ci   * @enum { number }
30361847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
30461847f8eSopenharmony_ci   * @atomicservice
30561847f8eSopenharmony_ci   * @since 12
30661847f8eSopenharmony_ci   */
30761847f8eSopenharmony_ci  enum ContentProtectionLevel {
30861847f8eSopenharmony_ci    /**
30961847f8eSopenharmony_ci     * Device decrypt and decode type unknown.
31061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
31161847f8eSopenharmony_ci     * @since 11
31261847f8eSopenharmony_ci     */
31361847f8eSopenharmony_ci    /**
31461847f8eSopenharmony_ci     * Device decrypt and decode type unknown.
31561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
31661847f8eSopenharmony_ci     * @atomicservice
31761847f8eSopenharmony_ci     * @since 12
31861847f8eSopenharmony_ci     */
31961847f8eSopenharmony_ci    CONTENT_PROTECTION_LEVEL_UNKNOWN = 0,
32061847f8eSopenharmony_ci    /**
32161847f8eSopenharmony_ci     * Device using software level.
32261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
32361847f8eSopenharmony_ci     * @since 11
32461847f8eSopenharmony_ci     */
32561847f8eSopenharmony_ci    /**
32661847f8eSopenharmony_ci     * Device using software level.
32761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
32861847f8eSopenharmony_ci     * @atomicservice
32961847f8eSopenharmony_ci     * @since 12
33061847f8eSopenharmony_ci     */
33161847f8eSopenharmony_ci    CONTENT_PROTECTION_LEVEL_SW_CRYPTO,
33261847f8eSopenharmony_ci    /**
33361847f8eSopenharmony_ci     * Device using hardware level.
33461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
33561847f8eSopenharmony_ci     * @since 11
33661847f8eSopenharmony_ci     */
33761847f8eSopenharmony_ci    /**
33861847f8eSopenharmony_ci     * Device using hardware level.
33961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
34061847f8eSopenharmony_ci     * @atomicservice
34161847f8eSopenharmony_ci     * @since 12
34261847f8eSopenharmony_ci     */
34361847f8eSopenharmony_ci    CONTENT_PROTECTION_LEVEL_HW_CRYPTO,
34461847f8eSopenharmony_ci    /**
34561847f8eSopenharmony_ci     * Device using enhanced hardware level.
34661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
34761847f8eSopenharmony_ci     * @since 11
34861847f8eSopenharmony_ci     */
34961847f8eSopenharmony_ci    /**
35061847f8eSopenharmony_ci     * Device using enhanced hardware level.
35161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
35261847f8eSopenharmony_ci     * @atomicservice
35361847f8eSopenharmony_ci     * @since 12
35461847f8eSopenharmony_ci     */
35561847f8eSopenharmony_ci    CONTENT_PROTECTION_LEVEL_ENHANCED_HW,
35661847f8eSopenharmony_ci    /**
35761847f8eSopenharmony_ci     * Max mode.
35861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
35961847f8eSopenharmony_ci     * @since 11
36061847f8eSopenharmony_ci     */
36161847f8eSopenharmony_ci    /**
36261847f8eSopenharmony_ci     * Max mode.
36361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
36461847f8eSopenharmony_ci     * @atomicservice
36561847f8eSopenharmony_ci     * @since 12
36661847f8eSopenharmony_ci     */
36761847f8eSopenharmony_ci    CONTENT_PROTECTION_LEVEL_MAX,
36861847f8eSopenharmony_ci  }
36961847f8eSopenharmony_ci
37061847f8eSopenharmony_ci  /**
37161847f8eSopenharmony_ci   * Provides the drm provision request definitions.
37261847f8eSopenharmony_ci   * @interface ProvisionRequest
37361847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
37461847f8eSopenharmony_ci   * @since 11
37561847f8eSopenharmony_ci   */
37661847f8eSopenharmony_ci  interface ProvisionRequest {
37761847f8eSopenharmony_ci    /**
37861847f8eSopenharmony_ci     * Provision request data sent to provision server.
37961847f8eSopenharmony_ci     * @type { Uint8Array }
38061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
38161847f8eSopenharmony_ci     * @since 11
38261847f8eSopenharmony_ci     */
38361847f8eSopenharmony_ci    data: Uint8Array;
38461847f8eSopenharmony_ci    /**
38561847f8eSopenharmony_ci     * Provision server URL.
38661847f8eSopenharmony_ci     * @type { string }
38761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
38861847f8eSopenharmony_ci     * @since 11
38961847f8eSopenharmony_ci     */
39061847f8eSopenharmony_ci    defaultURL: string;
39161847f8eSopenharmony_ci  }
39261847f8eSopenharmony_ci
39361847f8eSopenharmony_ci  /**
39461847f8eSopenharmony_ci   * Provides the drm media key request info optional data.
39561847f8eSopenharmony_ci   * @interface OptionsData
39661847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
39761847f8eSopenharmony_ci   * @since 11
39861847f8eSopenharmony_ci   */
39961847f8eSopenharmony_ci  /**
40061847f8eSopenharmony_ci   * Provides the drm media key request info optional data.
40161847f8eSopenharmony_ci   * @interface OptionsData
40261847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
40361847f8eSopenharmony_ci   * @atomicservice
40461847f8eSopenharmony_ci   * @since 12
40561847f8eSopenharmony_ci   */
40661847f8eSopenharmony_ci  interface OptionsData {
40761847f8eSopenharmony_ci    /**
40861847f8eSopenharmony_ci     * App defined optional data name.
40961847f8eSopenharmony_ci     * @type { string }
41061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
41161847f8eSopenharmony_ci     * @since 11
41261847f8eSopenharmony_ci     */
41361847f8eSopenharmony_ci    /**
41461847f8eSopenharmony_ci     * App defined optional data name.
41561847f8eSopenharmony_ci     * @type { string }
41661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
41761847f8eSopenharmony_ci     * @atomicservice
41861847f8eSopenharmony_ci     * @since 12
41961847f8eSopenharmony_ci     */
42061847f8eSopenharmony_ci    name: string;
42161847f8eSopenharmony_ci    /**
42261847f8eSopenharmony_ci     * App defined optional data value.
42361847f8eSopenharmony_ci     * @type { string }
42461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
42561847f8eSopenharmony_ci     * @since 11
42661847f8eSopenharmony_ci     */
42761847f8eSopenharmony_ci    /**
42861847f8eSopenharmony_ci     * App defined optional data value.
42961847f8eSopenharmony_ci     * @type { string }
43061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
43161847f8eSopenharmony_ci     * @atomicservice
43261847f8eSopenharmony_ci     * @since 12
43361847f8eSopenharmony_ci     */
43461847f8eSopenharmony_ci    value: string;
43561847f8eSopenharmony_ci  }
43661847f8eSopenharmony_ci
43761847f8eSopenharmony_ci  /**
43861847f8eSopenharmony_ci   * Provides the drm media key request definitions.
43961847f8eSopenharmony_ci   * @interface MediaKeyRequest
44061847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
44161847f8eSopenharmony_ci   * @since 11
44261847f8eSopenharmony_ci   */
44361847f8eSopenharmony_ci  /**
44461847f8eSopenharmony_ci   * Provides the drm media key request definitions.
44561847f8eSopenharmony_ci   * @interface MediaKeyRequest
44661847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
44761847f8eSopenharmony_ci   * @atomicservice
44861847f8eSopenharmony_ci   * @since 12
44961847f8eSopenharmony_ci   */
45061847f8eSopenharmony_ci  interface MediaKeyRequest {
45161847f8eSopenharmony_ci    /**
45261847f8eSopenharmony_ci     * Media key request type.
45361847f8eSopenharmony_ci     * @type { MediaKeyRequestType }
45461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
45561847f8eSopenharmony_ci     * @since 11
45661847f8eSopenharmony_ci     */
45761847f8eSopenharmony_ci    /**
45861847f8eSopenharmony_ci     * Media key request type.
45961847f8eSopenharmony_ci     * @type { MediaKeyRequestType }
46061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
46161847f8eSopenharmony_ci     * @atomicservice
46261847f8eSopenharmony_ci     * @since 12
46361847f8eSopenharmony_ci     */
46461847f8eSopenharmony_ci    mediaKeyRequestType: MediaKeyRequestType;
46561847f8eSopenharmony_ci    /**
46661847f8eSopenharmony_ci     * Media key request data sent to media key server.
46761847f8eSopenharmony_ci     * @type { Uint8Array }
46861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
46961847f8eSopenharmony_ci     * @since 11
47061847f8eSopenharmony_ci     */
47161847f8eSopenharmony_ci    /**
47261847f8eSopenharmony_ci     * Media key request data sent to media key server.
47361847f8eSopenharmony_ci     * @type { Uint8Array }
47461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
47561847f8eSopenharmony_ci     * @atomicservice
47661847f8eSopenharmony_ci     * @since 12
47761847f8eSopenharmony_ci     */
47861847f8eSopenharmony_ci    data: Uint8Array;
47961847f8eSopenharmony_ci    /**
48061847f8eSopenharmony_ci     * Media key server URL.
48161847f8eSopenharmony_ci     * @type { string }
48261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
48361847f8eSopenharmony_ci     * @since 11
48461847f8eSopenharmony_ci     */
48561847f8eSopenharmony_ci    /**
48661847f8eSopenharmony_ci     * Media key server URL.
48761847f8eSopenharmony_ci     * @type { string }
48861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
48961847f8eSopenharmony_ci     * @atomicservice
49061847f8eSopenharmony_ci     * @since 12
49161847f8eSopenharmony_ci     */
49261847f8eSopenharmony_ci    defaultURL: string;
49361847f8eSopenharmony_ci  }
49461847f8eSopenharmony_ci
49561847f8eSopenharmony_ci  /**
49661847f8eSopenharmony_ci   * Used to indicates the event info attached to specific event type.
49761847f8eSopenharmony_ci   * @interface EventInfo
49861847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
49961847f8eSopenharmony_ci   * @since 11
50061847f8eSopenharmony_ci   */
50161847f8eSopenharmony_ci  /**
50261847f8eSopenharmony_ci   * Used to indicates the event info attached to specific event type.
50361847f8eSopenharmony_ci   * @interface EventInfo
50461847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
50561847f8eSopenharmony_ci   * @atomicservice
50661847f8eSopenharmony_ci   * @since 12
50761847f8eSopenharmony_ci   */
50861847f8eSopenharmony_ci  interface EventInfo {
50961847f8eSopenharmony_ci    /**
51061847f8eSopenharmony_ci     * Event info.
51161847f8eSopenharmony_ci     * @type { Uint8Array }
51261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
51361847f8eSopenharmony_ci     * @since 11
51461847f8eSopenharmony_ci     */
51561847f8eSopenharmony_ci    /**
51661847f8eSopenharmony_ci     * Event info.
51761847f8eSopenharmony_ci     * @type { Uint8Array }
51861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
51961847f8eSopenharmony_ci     * @atomicservice
52061847f8eSopenharmony_ci     * @since 12
52161847f8eSopenharmony_ci     */
52261847f8eSopenharmony_ci    info: Uint8Array;
52361847f8eSopenharmony_ci    /**
52461847f8eSopenharmony_ci     * Event extra info.
52561847f8eSopenharmony_ci     * @type { string }
52661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
52761847f8eSopenharmony_ci     * @since 11
52861847f8eSopenharmony_ci     */
52961847f8eSopenharmony_ci    /**
53061847f8eSopenharmony_ci     * Event extra info.
53161847f8eSopenharmony_ci     * @type { string }
53261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
53361847f8eSopenharmony_ci     * @atomicservice
53461847f8eSopenharmony_ci     * @since 12
53561847f8eSopenharmony_ci     */
53661847f8eSopenharmony_ci    extraInfo: string;
53761847f8eSopenharmony_ci  }
53861847f8eSopenharmony_ci
53961847f8eSopenharmony_ci  /**
54061847f8eSopenharmony_ci   * Used to indicates the statistic info.
54161847f8eSopenharmony_ci   * @interface StatisticKeyValue
54261847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
54361847f8eSopenharmony_ci   * @since 11
54461847f8eSopenharmony_ci   */
54561847f8eSopenharmony_ci  interface StatisticKeyValue {
54661847f8eSopenharmony_ci    /**
54761847f8eSopenharmony_ci     * Statistic info name.
54861847f8eSopenharmony_ci     * @type { string }
54961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
55061847f8eSopenharmony_ci     * @since 11
55161847f8eSopenharmony_ci     */
55261847f8eSopenharmony_ci    name: string;
55361847f8eSopenharmony_ci    /**
55461847f8eSopenharmony_ci     * Statistic info value.
55561847f8eSopenharmony_ci     * @type { string }
55661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
55761847f8eSopenharmony_ci     * @since 11
55861847f8eSopenharmony_ci     */
55961847f8eSopenharmony_ci    value: string;
56061847f8eSopenharmony_ci  }
56161847f8eSopenharmony_ci
56261847f8eSopenharmony_ci  /**
56361847f8eSopenharmony_ci   * Used to indicates the media key status.
56461847f8eSopenharmony_ci   * @interface MediaKeyStatus
56561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
56661847f8eSopenharmony_ci   * @since 11
56761847f8eSopenharmony_ci   */
56861847f8eSopenharmony_ci  /**
56961847f8eSopenharmony_ci   * Used to indicates the media key status.
57061847f8eSopenharmony_ci   * @interface MediaKeyStatus
57161847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
57261847f8eSopenharmony_ci   * @atomicservice
57361847f8eSopenharmony_ci   * @since 12
57461847f8eSopenharmony_ci   */
57561847f8eSopenharmony_ci  interface MediaKeyStatus {
57661847f8eSopenharmony_ci    /**
57761847f8eSopenharmony_ci     * Media key Id in string.
57861847f8eSopenharmony_ci     * @type { string }
57961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
58061847f8eSopenharmony_ci     * @since 11
58161847f8eSopenharmony_ci     */
58261847f8eSopenharmony_ci    /**
58361847f8eSopenharmony_ci     * Media key Id in string.
58461847f8eSopenharmony_ci     * @type { string }
58561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
58661847f8eSopenharmony_ci     * @atomicservice
58761847f8eSopenharmony_ci     * @since 12
58861847f8eSopenharmony_ci     */
58961847f8eSopenharmony_ci    name: string;
59061847f8eSopenharmony_ci    /**
59161847f8eSopenharmony_ci     * Media key status description.
59261847f8eSopenharmony_ci     * @type { string }
59361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
59461847f8eSopenharmony_ci     * @since 11
59561847f8eSopenharmony_ci     */
59661847f8eSopenharmony_ci    /**
59761847f8eSopenharmony_ci     * Media key status description.
59861847f8eSopenharmony_ci     * @type { string }
59961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
60061847f8eSopenharmony_ci     * @atomicservice
60161847f8eSopenharmony_ci     * @since 12
60261847f8eSopenharmony_ci     */
60361847f8eSopenharmony_ci    value: string;
60461847f8eSopenharmony_ci  }
60561847f8eSopenharmony_ci
60661847f8eSopenharmony_ci  /**
60761847f8eSopenharmony_ci   * Used to indicates the media key status with a key and its value.
60861847f8eSopenharmony_ci   * @interface KeysInfo
60961847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
61061847f8eSopenharmony_ci   * @since 11
61161847f8eSopenharmony_ci   */
61261847f8eSopenharmony_ci  /**
61361847f8eSopenharmony_ci   * Used to indicates the media key status with a key and its value.
61461847f8eSopenharmony_ci   * @interface KeysInfo
61561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
61661847f8eSopenharmony_ci   * @atomicservice
61761847f8eSopenharmony_ci   * @since 12
61861847f8eSopenharmony_ci   */
61961847f8eSopenharmony_ci  interface KeysInfo {
62061847f8eSopenharmony_ci    /**
62161847f8eSopenharmony_ci     * Keys Id in media key.
62261847f8eSopenharmony_ci     * @type { Uint8Array }
62361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
62461847f8eSopenharmony_ci     * @since 11
62561847f8eSopenharmony_ci     */
62661847f8eSopenharmony_ci    /**
62761847f8eSopenharmony_ci     * Keys Id in media key.
62861847f8eSopenharmony_ci     * @type { Uint8Array }
62961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
63061847f8eSopenharmony_ci     * @atomicservice
63161847f8eSopenharmony_ci     * @since 12
63261847f8eSopenharmony_ci     */
63361847f8eSopenharmony_ci    keyId: Uint8Array;
63461847f8eSopenharmony_ci    /**
63561847f8eSopenharmony_ci     * Keys status description.
63661847f8eSopenharmony_ci     * @type { string }
63761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
63861847f8eSopenharmony_ci     * @since 11
63961847f8eSopenharmony_ci     */
64061847f8eSopenharmony_ci    /**
64161847f8eSopenharmony_ci     * Keys status description.
64261847f8eSopenharmony_ci     * @type { string }
64361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
64461847f8eSopenharmony_ci     * @atomicservice
64561847f8eSopenharmony_ci     * @since 12
64661847f8eSopenharmony_ci     */
64761847f8eSopenharmony_ci    value: string;
64861847f8eSopenharmony_ci  }
64961847f8eSopenharmony_ci
65061847f8eSopenharmony_ci  /**
65161847f8eSopenharmony_ci   * Used to indicates the media key system info of media source.
65261847f8eSopenharmony_ci   * @interface MediaKeySystemInfo
65361847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
65461847f8eSopenharmony_ci   * @since 11
65561847f8eSopenharmony_ci   */
65661847f8eSopenharmony_ci  /**
65761847f8eSopenharmony_ci   * Used to indicates the media key system info of media source.
65861847f8eSopenharmony_ci   * @interface MediaKeySystemInfo
65961847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
66061847f8eSopenharmony_ci   * @atomicservice
66161847f8eSopenharmony_ci   * @since 12
66261847f8eSopenharmony_ci   */
66361847f8eSopenharmony_ci  interface MediaKeySystemInfo {
66461847f8eSopenharmony_ci    /**
66561847f8eSopenharmony_ci     * Drm system ID.
66661847f8eSopenharmony_ci     * @type { string }
66761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
66861847f8eSopenharmony_ci     * @since 11
66961847f8eSopenharmony_ci     */
67061847f8eSopenharmony_ci    /**
67161847f8eSopenharmony_ci     * Drm system ID.
67261847f8eSopenharmony_ci     * @type { string }
67361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
67461847f8eSopenharmony_ci     * @atomicservice
67561847f8eSopenharmony_ci     * @since 12
67661847f8eSopenharmony_ci     */
67761847f8eSopenharmony_ci    uuid: string;
67861847f8eSopenharmony_ci    /**
67961847f8eSopenharmony_ci     * PSSH(protection scheme specific header) contain drm info.
68061847f8eSopenharmony_ci     * @type { Uint8Array }
68161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
68261847f8eSopenharmony_ci     * @since 11
68361847f8eSopenharmony_ci     */
68461847f8eSopenharmony_ci    /**
68561847f8eSopenharmony_ci     * PSSH(protection scheme specific header) contain drm info.
68661847f8eSopenharmony_ci     * @type { Uint8Array }
68761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
68861847f8eSopenharmony_ci     * @atomicservice
68961847f8eSopenharmony_ci     * @since 12
69061847f8eSopenharmony_ci     */
69161847f8eSopenharmony_ci    pssh: Uint8Array;
69261847f8eSopenharmony_ci  }
69361847f8eSopenharmony_ci
69461847f8eSopenharmony_ci/**
69561847f8eSopenharmony_ci   * Name and UUID of DRM plugin.
69661847f8eSopenharmony_ci   * @interface MediaKeySystemDescription
69761847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
69861847f8eSopenharmony_ci   * @since 12
69961847f8eSopenharmony_ci   */
70061847f8eSopenharmony_ci  interface MediaKeySystemDescription {
70161847f8eSopenharmony_ci    /**
70261847f8eSopenharmony_ci     * Name of DRM plugin.
70361847f8eSopenharmony_ci     * @type { string }
70461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
70561847f8eSopenharmony_ci     * @since 12
70661847f8eSopenharmony_ci     */
70761847f8eSopenharmony_ci    name: string;
70861847f8eSopenharmony_ci    /**
70961847f8eSopenharmony_ci     * UUID supported by DRM plugin.
71061847f8eSopenharmony_ci     * @type { string }
71161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
71261847f8eSopenharmony_ci     * @since 12
71361847f8eSopenharmony_ci     */
71461847f8eSopenharmony_ci    uuid: string;
71561847f8eSopenharmony_ci  }
71661847f8eSopenharmony_ci
71761847f8eSopenharmony_ci  /**
71861847f8eSopenharmony_ci   * Get a MediaKeySystem's UUID.
71961847f8eSopenharmony_ci   * @param { string } name - The Digital Right Management solution name.
72061847f8eSopenharmony_ci   * @returns { string } The MediaKeySystem uuid.
72161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed.Possibly because:
72261847f8eSopenharmony_ci   * <br>1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
72361847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
72461847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
72561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
72661847f8eSopenharmony_ci   * @since 12
72761847f8eSopenharmony_ci   */
72861847f8eSopenharmony_ci  function getMediaKeySystemUuid(name: string): string;
72961847f8eSopenharmony_ci
73061847f8eSopenharmony_ci  /**
73161847f8eSopenharmony_ci   * Get all media key systems supported.
73261847f8eSopenharmony_ci   * @returns { MediaKeySystemDescription[] } The MediaKeySystem name and uuid info list.
73361847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
73461847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
73561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
73661847f8eSopenharmony_ci   * @since 12
73761847f8eSopenharmony_ci   */
73861847f8eSopenharmony_ci  function getMediaKeySystems(): MediaKeySystemDescription[];
73961847f8eSopenharmony_ci
74061847f8eSopenharmony_ci  /**
74161847f8eSopenharmony_ci   * Creates a MediaKeySystem instance.
74261847f8eSopenharmony_ci   * @param { string } name - Used to point a Digital Right Management solution.
74361847f8eSopenharmony_ci   * @returns { MediaKeySystem } The MediaKeySystem instance.
74461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
74561847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
74661847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
74761847f8eSopenharmony_ci   * @throws { BusinessError } 24700103 - Meet max MediaKeySystem num limit.
74861847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
74961847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
75061847f8eSopenharmony_ci   * @since 11
75161847f8eSopenharmony_ci   */
75261847f8eSopenharmony_ci  function createMediaKeySystem(name: string): MediaKeySystem;
75361847f8eSopenharmony_ci
75461847f8eSopenharmony_ci  /**
75561847f8eSopenharmony_ci   * Judge whether a system that specifies name, mimetype and content protection level is supported.
75661847f8eSopenharmony_ci   * @param { string } name - Used to point a Digital Right Management solution.
75761847f8eSopenharmony_ci   * @param { string } mimeType - Used to specifies the media type.
75861847f8eSopenharmony_ci   * @param { ContentProtectionLevel } level - Used to specifies the ContentProtectionLevel.
75961847f8eSopenharmony_ci   * @returns { boolean } Whether these conditions will be met.
76061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
76161847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
76261847f8eSopenharmony_ci   * 3.Parameter verification failed.
76361847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
76461847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
76561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
76661847f8eSopenharmony_ci   * @since 11
76761847f8eSopenharmony_ci   */
76861847f8eSopenharmony_ci  function isMediaKeySystemSupported(name: string, mimeType: string, level: ContentProtectionLevel): boolean;
76961847f8eSopenharmony_ci
77061847f8eSopenharmony_ci  /**
77161847f8eSopenharmony_ci   * Judge whether a system that specifies name, mimetype is supported.
77261847f8eSopenharmony_ci   * @param { string } name - Used to point a Digital Right Management solution.
77361847f8eSopenharmony_ci   * @param { string } mimeType - Used to specifies the media type.
77461847f8eSopenharmony_ci   * @returns { boolean } Whether these conditions will be met.
77561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
77661847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
77761847f8eSopenharmony_ci   * 3.Parameter verification failed.
77861847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
77961847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
78061847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
78161847f8eSopenharmony_ci   * @since 11
78261847f8eSopenharmony_ci   */
78361847f8eSopenharmony_ci  function isMediaKeySystemSupported(name: string, mimeType: string): boolean;
78461847f8eSopenharmony_ci
78561847f8eSopenharmony_ci  /**
78661847f8eSopenharmony_ci   * Judge whether a system that specifies name is supported.
78761847f8eSopenharmony_ci   * @param { string } name - Used to point a Digital Right Management solution.
78861847f8eSopenharmony_ci   * @returns { boolean } Whether these conditions will be met.
78961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
79061847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
79161847f8eSopenharmony_ci   * the param name's length is zero or too big(exceeds 4096 Bytes).
79261847f8eSopenharmony_ci   * @throws { BusinessError } 24700101 - All unknown errors.
79361847f8eSopenharmony_ci   * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
79461847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
79561847f8eSopenharmony_ci   * @since 11
79661847f8eSopenharmony_ci   */
79761847f8eSopenharmony_ci  function isMediaKeySystemSupported(name: string): boolean;
79861847f8eSopenharmony_ci
79961847f8eSopenharmony_ci  /**
80061847f8eSopenharmony_ci   * Manages and record MediaKeySessions. Before calling an MediaKeySystem method, we must use getMediaKeySystem
80161847f8eSopenharmony_ci   * to get a MediaKeySystem instance, then we can call functions.
80261847f8eSopenharmony_ci   * @interface MediaKeySystem
80361847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
80461847f8eSopenharmony_ci   * @since 11
80561847f8eSopenharmony_ci   *
80661847f8eSopenharmony_ci   */
80761847f8eSopenharmony_ci  interface MediaKeySystem {
80861847f8eSopenharmony_ci    /**
80961847f8eSopenharmony_ci     * Get the specified configuration.
81061847f8eSopenharmony_ci     * @param { string } configName - Used to specify the config name.
81161847f8eSopenharmony_ci     * @returns { string } The config value string.
81261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
81361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
81461847f8eSopenharmony_ci     * the param's length is zero or too big(exceeds 4096 Bytes).
81561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
81661847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
81761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
81861847f8eSopenharmony_ci     * @since 11
81961847f8eSopenharmony_ci     */
82061847f8eSopenharmony_ci    getConfigurationString(configName: string): string;
82161847f8eSopenharmony_ci
82261847f8eSopenharmony_ci    /**
82361847f8eSopenharmony_ci     * Set the specified configuration.
82461847f8eSopenharmony_ci     * @param { string } configName - Used to specify the config name.
82561847f8eSopenharmony_ci     * @param { string } value - The value to be set.
82661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
82761847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
82861847f8eSopenharmony_ci     * 3.Parameter verification failed.
82961847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
83061847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
83161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
83261847f8eSopenharmony_ci     * @since 11
83361847f8eSopenharmony_ci     */
83461847f8eSopenharmony_ci    setConfigurationString(configName: string, value: string): void;
83561847f8eSopenharmony_ci
83661847f8eSopenharmony_ci    /**
83761847f8eSopenharmony_ci     * Get the specified configuration.
83861847f8eSopenharmony_ci     * @param { string } configName - Used to specify the config name.
83961847f8eSopenharmony_ci     * @returns { Uint8Array } The config value.
84061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
84161847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
84261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
84361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
84461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
84561847f8eSopenharmony_ci     * @since 11
84661847f8eSopenharmony_ci     */
84761847f8eSopenharmony_ci    getConfigurationByteArray(configName: string): Uint8Array;
84861847f8eSopenharmony_ci
84961847f8eSopenharmony_ci    /**
85061847f8eSopenharmony_ci     * Set the specified configuration.
85161847f8eSopenharmony_ci     * @param { string } configName - Used to specify the config name.
85261847f8eSopenharmony_ci     * @param { Uint8Array } value - The value to be set.
85361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
85461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
85561847f8eSopenharmony_ci     * 3.Parameter verification failed.
85661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
85761847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
85861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
85961847f8eSopenharmony_ci     * @since 11
86061847f8eSopenharmony_ci     */
86161847f8eSopenharmony_ci    setConfigurationByteArray(configName: string, value: Uint8Array): void;
86261847f8eSopenharmony_ci
86361847f8eSopenharmony_ci    /**
86461847f8eSopenharmony_ci     * Get performance statistics information.That includes currentSessionNum, version, decryptNumber,
86561847f8eSopenharmony_ci     * and errorDecryptNumber.
86661847f8eSopenharmony_ci     * @returns { StatisticKeyValue[] } A list that includes performance index and corresponding statistics.
86761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
86861847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
86961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
87061847f8eSopenharmony_ci     * @since 11
87161847f8eSopenharmony_ci     */
87261847f8eSopenharmony_ci    getStatistics(): StatisticKeyValue[];
87361847f8eSopenharmony_ci
87461847f8eSopenharmony_ci    /**
87561847f8eSopenharmony_ci     * Get max content protection level the device supports.
87661847f8eSopenharmony_ci     * @returns { ContentProtectionLevel } The max content protection level of the MediaKeySystem instance.
87761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
87861847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
87961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
88061847f8eSopenharmony_ci     * @since 11
88161847f8eSopenharmony_ci     */
88261847f8eSopenharmony_ci    getMaxContentProtectionLevel(): ContentProtectionLevel;
88361847f8eSopenharmony_ci
88461847f8eSopenharmony_ci    /**
88561847f8eSopenharmony_ci     * Generate a media key system provision request.
88661847f8eSopenharmony_ci     * @returns { Promise<ProvisionRequest> } Promise with ProvisionRequest used to return the result.
88761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
88861847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
88961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
89061847f8eSopenharmony_ci     * @since 11
89161847f8eSopenharmony_ci     */
89261847f8eSopenharmony_ci
89361847f8eSopenharmony_ci    generateKeySystemRequest(): Promise<ProvisionRequest>;
89461847f8eSopenharmony_ci
89561847f8eSopenharmony_ci    /**
89661847f8eSopenharmony_ci     * Process the response corresponding the key system request obtained by the application.
89761847f8eSopenharmony_ci     * @param { Uint8Array } response - Response corresponding to the request.
89861847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
89961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
90061847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
90161847f8eSopenharmony_ci     * 3.Parameter verification failed.
90261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
90361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
90461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
90561847f8eSopenharmony_ci     * @since 11
90661847f8eSopenharmony_ci     */
90761847f8eSopenharmony_ci    processKeySystemResponse(response: Uint8Array): Promise<void>;
90861847f8eSopenharmony_ci
90961847f8eSopenharmony_ci    /**
91061847f8eSopenharmony_ci     * Get certificate status of the MediaKeySystem.
91161847f8eSopenharmony_ci     * @returns { CertificateStatus } Certificate Status of the MediaKeySystem instance.
91261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
91361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
91461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
91561847f8eSopenharmony_ci     * @since 11
91661847f8eSopenharmony_ci     */
91761847f8eSopenharmony_ci    getCertificateStatus(): CertificateStatus;
91861847f8eSopenharmony_ci
91961847f8eSopenharmony_ci    /**
92061847f8eSopenharmony_ci     * Register keySystemRequired events.
92161847f8eSopenharmony_ci     * @param { 'keySystemRequired' } type - Type of the drm event to listen for.
92261847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key system required event.
92361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
92461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
92561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
92661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
92761847f8eSopenharmony_ci     * @since 11
92861847f8eSopenharmony_ci     */
92961847f8eSopenharmony_ci    on(type: 'keySystemRequired', callback: (eventInfo: EventInfo) => void): void;
93061847f8eSopenharmony_ci
93161847f8eSopenharmony_ci    /**
93261847f8eSopenharmony_ci     * Unregister keySystemRequired events.
93361847f8eSopenharmony_ci     * @param { 'keySystemRequired' } type - Type of the drm event to listen for.
93461847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key system required event.
93561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
93661847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
93761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
93861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
93961847f8eSopenharmony_ci     * @since 11
94061847f8eSopenharmony_ci     */
94161847f8eSopenharmony_ci    off(type: 'keySystemRequired', callback?: (eventInfo: EventInfo) => void): void;
94261847f8eSopenharmony_ci
94361847f8eSopenharmony_ci    /**
94461847f8eSopenharmony_ci     * Create a MediaKeySession instance with level.
94561847f8eSopenharmony_ci     * @param { ContentProtectionLevel } level - Used to specify the content protection level.
94661847f8eSopenharmony_ci     * @returns { MediaKeySession } A MediaKeySession instance.
94761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
94861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.The param level exceeds reasonable range,
94961847f8eSopenharmony_ci     * please use value in ContentProtectionLevel.
95061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
95161847f8eSopenharmony_ci     * @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
95261847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
95361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
95461847f8eSopenharmony_ci     * @since 11
95561847f8eSopenharmony_ci     */
95661847f8eSopenharmony_ci    createMediaKeySession(level: ContentProtectionLevel): MediaKeySession;
95761847f8eSopenharmony_ci
95861847f8eSopenharmony_ci    /**
95961847f8eSopenharmony_ci     * Create a MediaKeySession instance.
96061847f8eSopenharmony_ci     * @returns { MediaKeySession } A MediaKeySession instance.
96161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
96261847f8eSopenharmony_ci     * @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
96361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
96461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
96561847f8eSopenharmony_ci     * @since 11
96661847f8eSopenharmony_ci     */
96761847f8eSopenharmony_ci    createMediaKeySession(): MediaKeySession;
96861847f8eSopenharmony_ci
96961847f8eSopenharmony_ci    /**
97061847f8eSopenharmony_ci     * Get the list of offline MediaKeyIds.
97161847f8eSopenharmony_ci     * @returns { Uint8Array[] } The list of offline MediaKeyIds.
97261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
97361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
97461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
97561847f8eSopenharmony_ci     * @since 11
97661847f8eSopenharmony_ci     */
97761847f8eSopenharmony_ci    getOfflineMediaKeyIds(): Uint8Array[];
97861847f8eSopenharmony_ci
97961847f8eSopenharmony_ci    /**
98061847f8eSopenharmony_ci     * Get offline media key status corresponding to the mediaKeyId.
98161847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The media key identifier.
98261847f8eSopenharmony_ci     * @returns { OfflineMediaKeyStatus } Offline media key Status.
98361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
98461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
98561847f8eSopenharmony_ci     * 3.Parameter verification failed.
98661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
98761847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
98861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
98961847f8eSopenharmony_ci     * @since 11
99061847f8eSopenharmony_ci     */
99161847f8eSopenharmony_ci    getOfflineMediaKeyStatus(mediaKeyId: Uint8Array): OfflineMediaKeyStatus;
99261847f8eSopenharmony_ci
99361847f8eSopenharmony_ci    /**
99461847f8eSopenharmony_ci     * Remove media key corresponding to the mediaKeyId.
99561847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be clear.
99661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed.Possibly because:
99761847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
99861847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
99961847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
100061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
100161847f8eSopenharmony_ci     * @since 11
100261847f8eSopenharmony_ci     */
100361847f8eSopenharmony_ci    clearOfflineMediaKeys(mediaKeyId: Uint8Array): void;
100461847f8eSopenharmony_ci    /**
100561847f8eSopenharmony_ci     * Release the resource before the MediaKeySystem gonna be unused.
100661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
100761847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
100861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
100961847f8eSopenharmony_ci     * @since 11
101061847f8eSopenharmony_ci     */
101161847f8eSopenharmony_ci    destroy(): void;
101261847f8eSopenharmony_ci  }
101361847f8eSopenharmony_ci
101461847f8eSopenharmony_ci  /**
101561847f8eSopenharmony_ci   * Provide functions and keep a decrypt module. Before calling an MediaKeySession method, we must
101661847f8eSopenharmony_ci   * use MediaKeySystem's createMediaKeySession to get a MediaKeySession instance.
101761847f8eSopenharmony_ci   * @interface MediaKeySession
101861847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
101961847f8eSopenharmony_ci   * @since 11
102061847f8eSopenharmony_ci   */
102161847f8eSopenharmony_ci  /**
102261847f8eSopenharmony_ci   * Provide functions and keep a decrypt module. Before calling an MediaKeySession method, we must
102361847f8eSopenharmony_ci   * use MediaKeySystem's createMediaKeySession to get a MediaKeySession instance.
102461847f8eSopenharmony_ci   * @interface MediaKeySession
102561847f8eSopenharmony_ci   * @syscap SystemCapability.Multimedia.Drm.Core
102661847f8eSopenharmony_ci   * @atomicservice
102761847f8eSopenharmony_ci   * @since 12
102861847f8eSopenharmony_ci   */
102961847f8eSopenharmony_ci  interface MediaKeySession {
103061847f8eSopenharmony_ci
103161847f8eSopenharmony_ci    /**
103261847f8eSopenharmony_ci     * Generate the media key request.
103361847f8eSopenharmony_ci     * @param { string } mimeType - Media type.
103461847f8eSopenharmony_ci     * @param { Uint8Array } initData - PSSH info.
103561847f8eSopenharmony_ci     * @param { number } mediaKeyType - Offline or online.
103661847f8eSopenharmony_ci     * @param { OptionsData[] } options - Optional data the application set to drm framework.
103761847f8eSopenharmony_ci     * @returns { Promise<MediaKeyRequest> } Promise with MediaKeyRequest used to return the result.
103861847f8eSopenharmony_ci     * @throws { BusinessError } 401 -The parameter check failed. Possibly because:
103961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
104061847f8eSopenharmony_ci     * 3.Parameter verification failed.
104161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
104261847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
104361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
104461847f8eSopenharmony_ci     * @since 11
104561847f8eSopenharmony_ci     */
104661847f8eSopenharmony_ci    /**
104761847f8eSopenharmony_ci     * Generate the media key request.
104861847f8eSopenharmony_ci     * @param { string } mimeType - Media type.
104961847f8eSopenharmony_ci     * @param { Uint8Array } initData - PSSH info.
105061847f8eSopenharmony_ci     * @param { number } mediaKeyType - Offline or online.
105161847f8eSopenharmony_ci     * @param { OptionsData[] } options - Optional data the application set to drm framework.
105261847f8eSopenharmony_ci     * @returns { Promise<MediaKeyRequest> } Promise with MediaKeyRequest used to return the result.
105361847f8eSopenharmony_ci     * @throws { BusinessError } 401 -The parameter check failed. Possibly because:
105461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
105561847f8eSopenharmony_ci     * 3.Parameter verification failed.
105661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
105761847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
105861847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
105961847f8eSopenharmony_ci     * @atomicservice
106061847f8eSopenharmony_ci     * @since 12
106161847f8eSopenharmony_ci     */
106261847f8eSopenharmony_ci    generateMediaKeyRequest(mimeType: string, initData: Uint8Array, mediaKeyType: number, options?: OptionsData[]): Promise<MediaKeyRequest>;
106361847f8eSopenharmony_ci
106461847f8eSopenharmony_ci    /**
106561847f8eSopenharmony_ci     * Process the response corresponding to the media key request obtained by the application.
106661847f8eSopenharmony_ci     * @param { Uint8Array } response - The response.
106761847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Promise with media key identifier in Uint8ARRY used to return the result.
106861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
106961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
107061847f8eSopenharmony_ci     * 3.Parameter verification failed.
107161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
107261847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
107361847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
107461847f8eSopenharmony_ci     * @since 11
107561847f8eSopenharmony_ci     */
107661847f8eSopenharmony_ci    /**
107761847f8eSopenharmony_ci     * Process the response corresponding to the media key request obtained by the application.
107861847f8eSopenharmony_ci     * @param { Uint8Array } response - The response.
107961847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Promise with media key identifier in Uint8ARRY used to return the result.
108061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
108161847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
108261847f8eSopenharmony_ci     * 3.Parameter verification failed.
108361847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
108461847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
108561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
108661847f8eSopenharmony_ci     * @atomicservice
108761847f8eSopenharmony_ci     * @since 12
108861847f8eSopenharmony_ci     */
108961847f8eSopenharmony_ci    processMediaKeyResponse(response: Uint8Array): Promise<Uint8Array>;
109061847f8eSopenharmony_ci
109161847f8eSopenharmony_ci    /**
109261847f8eSopenharmony_ci     * Check the media key status
109361847f8eSopenharmony_ci     * @returns { MediaKeyStatus[] } A list of media key status description pairs.
109461847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
109561847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
109661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
109761847f8eSopenharmony_ci     * @since 11
109861847f8eSopenharmony_ci     */
109961847f8eSopenharmony_ci    /**
110061847f8eSopenharmony_ci     * Check the media key status
110161847f8eSopenharmony_ci     * @returns { MediaKeyStatus[] } A list of media key status description pairs.
110261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
110361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
110461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
110561847f8eSopenharmony_ci     * @atomicservice
110661847f8eSopenharmony_ci     * @since 12
110761847f8eSopenharmony_ci     */
110861847f8eSopenharmony_ci    checkMediaKeyStatus(): MediaKeyStatus[];
110961847f8eSopenharmony_ci
111061847f8eSopenharmony_ci    /**
111161847f8eSopenharmony_ci     * Remove media key.
111261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
111361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
111461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
111561847f8eSopenharmony_ci     * @since 11
111661847f8eSopenharmony_ci     */
111761847f8eSopenharmony_ci    /**
111861847f8eSopenharmony_ci     * Remove media key.
111961847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
112061847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
112161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
112261847f8eSopenharmony_ci     * @atomicservice
112361847f8eSopenharmony_ci     * @since 12
112461847f8eSopenharmony_ci     */
112561847f8eSopenharmony_ci    clearMediaKeys(): void;
112661847f8eSopenharmony_ci
112761847f8eSopenharmony_ci    /**
112861847f8eSopenharmony_ci     * Generate offline media key request.
112961847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key request
113061847f8eSopenharmony_ci     * should be generated.
113161847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Promise with media key request in Uint8Array used to return the result.
113261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
113361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
113461847f8eSopenharmony_ci     * 3.Parameter verification failed.
113561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
113661847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
113761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
113861847f8eSopenharmony_ci     * @since 11
113961847f8eSopenharmony_ci     */
114061847f8eSopenharmony_ci    /**
114161847f8eSopenharmony_ci     * Generate offline media key request.
114261847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key request
114361847f8eSopenharmony_ci     * should be generated.
114461847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Promise with media key request in Uint8Array used to return the result.
114561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
114661847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
114761847f8eSopenharmony_ci     * 3.Parameter verification failed.
114861847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
114961847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
115061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
115161847f8eSopenharmony_ci     * @atomicservice
115261847f8eSopenharmony_ci     * @since 12
115361847f8eSopenharmony_ci     */
115461847f8eSopenharmony_ci    generateOfflineReleaseRequest(mediaKeyId: Uint8Array): Promise<Uint8Array>;
115561847f8eSopenharmony_ci
115661847f8eSopenharmony_ci    /**
115761847f8eSopenharmony_ci     * Process offline media key response.
115861847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key it is.
115961847f8eSopenharmony_ci     * @param { Uint8Array } response - The offline media key.
116061847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
116161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
116261847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
116361847f8eSopenharmony_ci     * 3.Parameter verification failed.
116461847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
116561847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
116661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
116761847f8eSopenharmony_ci     * @since 11
116861847f8eSopenharmony_ci     */
116961847f8eSopenharmony_ci    /**
117061847f8eSopenharmony_ci     * Process offline media key response.
117161847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key it is.
117261847f8eSopenharmony_ci     * @param { Uint8Array } response - The offline media key.
117361847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
117461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
117561847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
117661847f8eSopenharmony_ci     * 3.Parameter verification failed.
117761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
117861847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
117961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
118061847f8eSopenharmony_ci     * @atomicservice
118161847f8eSopenharmony_ci     * @since 12
118261847f8eSopenharmony_ci     */
118361847f8eSopenharmony_ci    processOfflineReleaseResponse(mediaKeyId: Uint8Array, response: Uint8Array): Promise<void>;
118461847f8eSopenharmony_ci
118561847f8eSopenharmony_ci    /**
118661847f8eSopenharmony_ci     * Restore offline media key.
118761847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be restore.
118861847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
118961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
119061847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
119161847f8eSopenharmony_ci     * 3.Parameter verification failed.
119261847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
119361847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
119461847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
119561847f8eSopenharmony_ci     * @since 11
119661847f8eSopenharmony_ci     */
119761847f8eSopenharmony_ci    /**
119861847f8eSopenharmony_ci     * Restore offline media key.
119961847f8eSopenharmony_ci     * @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be restore.
120061847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
120161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
120261847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
120361847f8eSopenharmony_ci     * 3.Parameter verification failed.
120461847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
120561847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
120661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
120761847f8eSopenharmony_ci     * @atomicservice
120861847f8eSopenharmony_ci     * @since 12
120961847f8eSopenharmony_ci     */
121061847f8eSopenharmony_ci    restoreOfflineMediaKeys(mediaKeyId: Uint8Array): Promise<void>;
121161847f8eSopenharmony_ci
121261847f8eSopenharmony_ci    /**
121361847f8eSopenharmony_ci     * Get content protection level.
121461847f8eSopenharmony_ci     * @returns { ContentProtectionLevel } MediaKeySession content protection level.
121561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
121661847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
121761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
121861847f8eSopenharmony_ci     * @since 11
121961847f8eSopenharmony_ci     */
122061847f8eSopenharmony_ci    /**
122161847f8eSopenharmony_ci     * Get content protection level.
122261847f8eSopenharmony_ci     * @returns { ContentProtectionLevel } MediaKeySession content protection level.
122361847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
122461847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
122561847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
122661847f8eSopenharmony_ci     * @atomicservice
122761847f8eSopenharmony_ci     * @since 12
122861847f8eSopenharmony_ci     */
122961847f8eSopenharmony_ci    getContentProtectionLevel(): ContentProtectionLevel;
123061847f8eSopenharmony_ci
123161847f8eSopenharmony_ci    /**
123261847f8eSopenharmony_ci     * Whether the encrypted content require a secure decoder or not.
123361847f8eSopenharmony_ci     * @param { string } mimeType - The media type.
123461847f8eSopenharmony_ci     * @returns { boolean } Whether secure decoder is required.
123561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
123661847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
123761847f8eSopenharmony_ci     * 3.Parameter verification failed.
123861847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
123961847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
124061847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
124161847f8eSopenharmony_ci     * @since 11
124261847f8eSopenharmony_ci     */
124361847f8eSopenharmony_ci    /**
124461847f8eSopenharmony_ci     * Whether the encrypted content require a secure decoder or not.
124561847f8eSopenharmony_ci     * @param { string } mimeType - The media type.
124661847f8eSopenharmony_ci     * @returns { boolean } Whether secure decoder is required.
124761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
124861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
124961847f8eSopenharmony_ci     * 3.Parameter verification failed.
125061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
125161847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
125261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
125361847f8eSopenharmony_ci     * @atomicservice
125461847f8eSopenharmony_ci     * @since 12
125561847f8eSopenharmony_ci     */
125661847f8eSopenharmony_ci    requireSecureDecoderModule(mimeType: string): boolean;
125761847f8eSopenharmony_ci
125861847f8eSopenharmony_ci    /**
125961847f8eSopenharmony_ci     * Register keyRequired event.
126061847f8eSopenharmony_ci     * @param { 'keyRequired' } type - Type of the drm event to listen for.
126161847f8eSopenharmony_ci     * @param { function } callback used to listen for the key required event.
126261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
126361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
126461847f8eSopenharmony_ci     * 3.Parameter verification failed.
126561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
126661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
126761847f8eSopenharmony_ci     * @since 11
126861847f8eSopenharmony_ci     */
126961847f8eSopenharmony_ci    /**
127061847f8eSopenharmony_ci     * Register keyRequired event.
127161847f8eSopenharmony_ci     * @param { 'keyRequired' } type - Type of the drm event to listen for.
127261847f8eSopenharmony_ci     * @param { function } callback used to listen for the key required event.
127361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
127461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
127561847f8eSopenharmony_ci     * 3.Parameter verification failed.
127661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
127761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
127861847f8eSopenharmony_ci     * @atomicservice
127961847f8eSopenharmony_ci     * @since 12
128061847f8eSopenharmony_ci     */
128161847f8eSopenharmony_ci    on(type: 'keyRequired', callback: (eventInfo: EventInfo) => void): void;
128261847f8eSopenharmony_ci
128361847f8eSopenharmony_ci    /**
128461847f8eSopenharmony_ci     * Unregister keyRequired event.
128561847f8eSopenharmony_ci     * @param { 'keyRequired' } type - Type of the drm event to listen for.
128661847f8eSopenharmony_ci     * @param { function } callback used to listen for the key required event.
128761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
128861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
128961847f8eSopenharmony_ci     * 3.Parameter verification failed.
129061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
129161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
129261847f8eSopenharmony_ci     * @since 11
129361847f8eSopenharmony_ci     */
129461847f8eSopenharmony_ci    /**
129561847f8eSopenharmony_ci     * Unregister keyRequired event.
129661847f8eSopenharmony_ci     * @param { 'keyRequired' } type - Type of the drm event to listen for.
129761847f8eSopenharmony_ci     * @param { function } callback used to listen for the key required event.
129861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
129961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
130061847f8eSopenharmony_ci     * 3.Parameter verification failed.
130161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
130261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
130361847f8eSopenharmony_ci     * @atomicservice
130461847f8eSopenharmony_ci     * @since 12
130561847f8eSopenharmony_ci     */
130661847f8eSopenharmony_ci    off(type: 'keyRequired', callback?: (eventInfo: EventInfo) => void): void;
130761847f8eSopenharmony_ci
130861847f8eSopenharmony_ci    /**
130961847f8eSopenharmony_ci     * Register keyExpired event.
131061847f8eSopenharmony_ci     * @param { 'keyExpired' } type - Type of the drm event to listen for.
131161847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key required event.
131261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
131361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
131461847f8eSopenharmony_ci     * 3.Parameter verification failed.
131561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
131661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
131761847f8eSopenharmony_ci     * @since 11
131861847f8eSopenharmony_ci     */
131961847f8eSopenharmony_ci    /**
132061847f8eSopenharmony_ci     * Register keyExpired event.
132161847f8eSopenharmony_ci     * @param { 'keyExpired' } type - Type of the drm event to listen for.
132261847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key required event.
132361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
132461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
132561847f8eSopenharmony_ci     * 3.Parameter verification failed.
132661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
132761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
132861847f8eSopenharmony_ci     * @atomicservice
132961847f8eSopenharmony_ci     * @since 12
133061847f8eSopenharmony_ci     */
133161847f8eSopenharmony_ci    on(type: 'keyExpired', callback: (eventInfo: EventInfo) => void): void;
133261847f8eSopenharmony_ci
133361847f8eSopenharmony_ci    /**
133461847f8eSopenharmony_ci     * Unregister keyExpired event.
133561847f8eSopenharmony_ci     * @param { 'keyExpired' } type - Type of the drm event to listen for.
133661847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key required event.
133761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
133861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
133961847f8eSopenharmony_ci     * 3.Parameter verification failed.
134061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
134161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
134261847f8eSopenharmony_ci     * @since 11
134361847f8eSopenharmony_ci     */
134461847f8eSopenharmony_ci    /**
134561847f8eSopenharmony_ci     * Unregister keyExpired event.
134661847f8eSopenharmony_ci     * @param { 'keyExpired' } type - Type of the drm event to listen for.
134761847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the key required event.
134861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
134961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
135061847f8eSopenharmony_ci     * 3.Parameter verification failed.
135161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
135261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
135361847f8eSopenharmony_ci     * @atomicservice
135461847f8eSopenharmony_ci     * @since 12
135561847f8eSopenharmony_ci     */
135661847f8eSopenharmony_ci    off(type: 'keyExpired', callback?: (eventInfo: EventInfo) => void): void;
135761847f8eSopenharmony_ci
135861847f8eSopenharmony_ci    /**
135961847f8eSopenharmony_ci     * Register vendorDefined event.
136061847f8eSopenharmony_ci     * @param { 'vendorDefined' } type - Type of the drm event to listen for.
136161847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the vendor defined event.
136261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
136361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
136461847f8eSopenharmony_ci     * 3.Parameter verification failed.
136561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
136661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
136761847f8eSopenharmony_ci     * @since 11
136861847f8eSopenharmony_ci     */
136961847f8eSopenharmony_ci    /**
137061847f8eSopenharmony_ci     * Register vendorDefined event.
137161847f8eSopenharmony_ci     * @param { 'vendorDefined' } type - Type of the drm event to listen for.
137261847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the vendor defined event.
137361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
137461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
137561847f8eSopenharmony_ci     * 3.Parameter verification failed.
137661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
137761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
137861847f8eSopenharmony_ci     * @atomicservice
137961847f8eSopenharmony_ci     * @since 12
138061847f8eSopenharmony_ci     */
138161847f8eSopenharmony_ci    on(type: 'vendorDefined', callback: (eventInfo: EventInfo) => void): void;
138261847f8eSopenharmony_ci
138361847f8eSopenharmony_ci    /**
138461847f8eSopenharmony_ci     * Unregister vendorDefined event.
138561847f8eSopenharmony_ci     * @param { 'vendorDefined' } type - Type of the drm event to listen for.
138661847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the vendor defined event.
138761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
138861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
138961847f8eSopenharmony_ci     * 3.Parameter verification failed.
139061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
139161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
139261847f8eSopenharmony_ci     * @since 11
139361847f8eSopenharmony_ci     */
139461847f8eSopenharmony_ci    /**
139561847f8eSopenharmony_ci     * Unregister vendorDefined event.
139661847f8eSopenharmony_ci     * @param { 'vendorDefined' } type - Type of the drm event to listen for.
139761847f8eSopenharmony_ci     * @param { function } callback - Used to listen for the vendor defined event.
139861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
139961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
140061847f8eSopenharmony_ci     * 3.Parameter verification failed.
140161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
140261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
140361847f8eSopenharmony_ci     * @atomicservice
140461847f8eSopenharmony_ci     * @since 12
140561847f8eSopenharmony_ci     */
140661847f8eSopenharmony_ci    off(type: 'vendorDefined', callback?: (eventInfo: EventInfo) => void): void;
140761847f8eSopenharmony_ci
140861847f8eSopenharmony_ci    /**
140961847f8eSopenharmony_ci     * Register expirationUpdate event.
141061847f8eSopenharmony_ci     * @param { 'expirationUpdate' } type - Type of the drm event to listen for.
141161847f8eSopenharmony_ci     * @param { function } callback - Used to listen for expiration update event.
141261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
141361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
141461847f8eSopenharmony_ci     * 3.Parameter verification failed.
141561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
141661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
141761847f8eSopenharmony_ci     * @since 11
141861847f8eSopenharmony_ci     */
141961847f8eSopenharmony_ci    /**
142061847f8eSopenharmony_ci     * Register expirationUpdate event.
142161847f8eSopenharmony_ci     * @param { 'expirationUpdate' } type - Type of the drm event to listen for.
142261847f8eSopenharmony_ci     * @param { function } callback - Used to listen for expiration update event.
142361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
142461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
142561847f8eSopenharmony_ci     * 3.Parameter verification failed.
142661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
142761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
142861847f8eSopenharmony_ci     * @atomicservice
142961847f8eSopenharmony_ci     * @since 12
143061847f8eSopenharmony_ci     */
143161847f8eSopenharmony_ci    on(type: 'expirationUpdate', callback: (eventInfo: EventInfo) => void): void;
143261847f8eSopenharmony_ci
143361847f8eSopenharmony_ci    /**
143461847f8eSopenharmony_ci     * Unregister expirationUpdate event.
143561847f8eSopenharmony_ci     * @param { 'expirationUpdate' } type - Type of the drm event to listen for.
143661847f8eSopenharmony_ci     * @param { function } callback - Used to listen for expiration update event.
143761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
143861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
143961847f8eSopenharmony_ci     * 3.Parameter verification failed.
144061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
144161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
144261847f8eSopenharmony_ci     * @since 11
144361847f8eSopenharmony_ci     */
144461847f8eSopenharmony_ci    /**
144561847f8eSopenharmony_ci     * Unregister expirationUpdate event.
144661847f8eSopenharmony_ci     * @param { 'expirationUpdate' } type - Type of the drm event to listen for.
144761847f8eSopenharmony_ci     * @param { function } callback - Used to listen for expiration update event.
144861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
144961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
145061847f8eSopenharmony_ci     * 3.Parameter verification failed.
145161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
145261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
145361847f8eSopenharmony_ci     * @atomicservice
145461847f8eSopenharmony_ci     * @since 12
145561847f8eSopenharmony_ci     */
145661847f8eSopenharmony_ci    off(type: 'expirationUpdate', callback?: (eventInfo: EventInfo) => void): void;
145761847f8eSopenharmony_ci
145861847f8eSopenharmony_ci    /**
145961847f8eSopenharmony_ci     * Register keysChange event.
146061847f8eSopenharmony_ci     * @param { 'keysChange' } type - Type of the drm event to listen for.
146161847f8eSopenharmony_ci     * @param { function } callback - Used to listen for keys change event.
146261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
146361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
146461847f8eSopenharmony_ci     * 3.Parameter verification failed.
146561847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
146661847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
146761847f8eSopenharmony_ci     * @since 11
146861847f8eSopenharmony_ci     */
146961847f8eSopenharmony_ci    /**
147061847f8eSopenharmony_ci     * Register keysChange event.
147161847f8eSopenharmony_ci     * @param { 'keysChange' } type - Type of the drm event to listen for.
147261847f8eSopenharmony_ci     * @param { function } callback - Used to listen for keys change event.
147361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
147461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
147561847f8eSopenharmony_ci     * 3.Parameter verification failed.
147661847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
147761847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
147861847f8eSopenharmony_ci     * @atomicservice
147961847f8eSopenharmony_ci     * @since 12
148061847f8eSopenharmony_ci     */
148161847f8eSopenharmony_ci    on(type: 'keysChange', callback: (keyInfo: KeysInfo[], newKeyAvailable: boolean) => void): void;
148261847f8eSopenharmony_ci
148361847f8eSopenharmony_ci    /**
148461847f8eSopenharmony_ci     * Unregister keysChange event.
148561847f8eSopenharmony_ci     * @param { 'keysChange' } type - Type of the drm event to listen for.
148661847f8eSopenharmony_ci     * @param { function } callback - Used to listen for keys change event.
148761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
148861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
148961847f8eSopenharmony_ci     * 3.Parameter verification failed.
149061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
149161847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
149261847f8eSopenharmony_ci     * @since 11
149361847f8eSopenharmony_ci     */
149461847f8eSopenharmony_ci    /**
149561847f8eSopenharmony_ci     * Unregister keysChange event.
149661847f8eSopenharmony_ci     * @param { 'keysChange' } type - Type of the drm event to listen for.
149761847f8eSopenharmony_ci     * @param { function } callback - Used to listen for keys change event.
149861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - The parameter check failed. Possibly because:
149961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
150061847f8eSopenharmony_ci     * 3.Parameter verification failed.
150161847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
150261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
150361847f8eSopenharmony_ci     * @atomicservice
150461847f8eSopenharmony_ci     * @since 12
150561847f8eSopenharmony_ci     */
150661847f8eSopenharmony_ci    off(type: 'keysChange', callback?: (keyInfo: KeysInfo[], newKeyAvailable: boolean) => void): void;
150761847f8eSopenharmony_ci
150861847f8eSopenharmony_ci    /**
150961847f8eSopenharmony_ci     * Release the resource before the session gonna be unused.
151061847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
151161847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
151261847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
151361847f8eSopenharmony_ci     * @since 11
151461847f8eSopenharmony_ci     */
151561847f8eSopenharmony_ci    /**
151661847f8eSopenharmony_ci     * Release the resource before the session gonna be unused.
151761847f8eSopenharmony_ci     * @throws { BusinessError } 24700101 - All unknown errors.
151861847f8eSopenharmony_ci     * @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
151961847f8eSopenharmony_ci     * @syscap SystemCapability.Multimedia.Drm.Core
152061847f8eSopenharmony_ci     * @atomicservice
152161847f8eSopenharmony_ci     * @since 12
152261847f8eSopenharmony_ci     */
152361847f8eSopenharmony_ci    destroy(): void;
152461847f8eSopenharmony_ci
152561847f8eSopenharmony_ci  }
152661847f8eSopenharmony_ci}
152761847f8eSopenharmony_ci
152861847f8eSopenharmony_ciexport default drm;
1529