// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/digital-goods/blob/main/explainer.md
[
SecureContext,
RuntimeEnabled=DigitalGoods
] interface DigitalGoodsService {
[CallWith=ScriptState, MeasureAs=DigitalGoodsGetDetails]
Promise<sequence<ItemDetails>> getDetails(sequence<DOMString> itemIds);
[CallWith=ScriptState, MeasureAs=DigitalGoodsListPurchases]
Promise<sequence<PurchaseDetails>> listPurchases();
[CallWith=ScriptState, MeasureAs=DigitalGoodsListPurchaseHistory, RuntimeEnabled=DigitalGoodsV2_1]
Promise<sequence<PurchaseDetails>> listPurchaseHistory();
[CallWith=ScriptState, MeasureAs=DigitalGoodsConsume]
Promise<undefined> consume(DOMString purchaseToken);
};