|
| 1 | +/* |
| 2 | + * Copyright 2013 cruxframework.org. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | + * use this file except in compliance with the License. You may obtain a copy of |
| 6 | + * the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + * License for the specific language governing permissions and limitations under |
| 14 | + * the License. |
| 15 | + */ |
| 16 | +package org.cruxframework.crux.plugin.cordova.client.plugin.cache; |
| 17 | + |
| 18 | +import jsinterop.annotations.JsFunction; |
| 19 | +import jsinterop.annotations.JsPackage; |
| 20 | +import jsinterop.annotations.JsType; |
| 21 | + |
| 22 | +/** |
| 23 | + * @author Samuel Almeida Cardoso |
| 24 | + * Pluggin mapping for: https://github.com/moderna/cordova-plugin-cache |
| 25 | + */ |
| 26 | +@JsType(namespace=JsPackage.GLOBAL, name="cache") |
| 27 | +public class CacheHandlerPlugin |
| 28 | +{ |
| 29 | + private CacheHandlerPlugin(){} |
| 30 | + |
| 31 | + public static native void clear(CacheSuccessCallback cacheSuccessCallback, |
| 32 | + CacheErrorCallback cacheErrorCallback); |
| 33 | + |
| 34 | + @JsFunction |
| 35 | + public static interface CacheSuccessCallback |
| 36 | + { |
| 37 | + void onSuccess(String status); |
| 38 | + } |
| 39 | + |
| 40 | + @JsFunction |
| 41 | + public static interface CacheErrorCallback |
| 42 | + { |
| 43 | + void onError(String status); |
| 44 | + } |
| 45 | +} |
0 commit comments