FIRPersistentCacheIndexManager.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2023 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of 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,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /**
  19. * A PersistentCacheIndexManager, for configuring persistent cache indexes used for local query
  20. * execution.
  21. */
  22. NS_SWIFT_NAME(PersistentCacheIndexManager)
  23. @interface FIRPersistentCacheIndexManager : NSObject
  24. /** :nodoc: */
  25. - (instancetype)init
  26. __attribute__((unavailable("FIRPersistentCacheIndexManager cannot be created directly.")));
  27. /**
  28. * Enables the SDK to create persistent cache indexes automatically for local query execution when
  29. * the SDK believes cache indexes can improve performance.
  30. *
  31. * This feature is disabled by default.
  32. */
  33. - (void)enableIndexAutoCreation NS_SWIFT_NAME(enableIndexAutoCreation());
  34. /**
  35. * Stops creating persistent cache indexes automatically for local query execution. The indexes
  36. * which have been created by calling `enableIndexAutoCreation` still take effect.
  37. */
  38. - (void)disableIndexAutoCreation NS_SWIFT_NAME(disableIndexAutoCreation());
  39. /**
  40. * Removes all persistent cache indexes. Please note this function also deletes indexes generated by
  41. * [[FIRFirestore firestore] setIndexConfigurationFromJSON] and [[FIRFirestore firestore]
  42. * setIndexConfigurationFromStream], which are deprecated.
  43. */
  44. - (void)deleteAllIndexes NS_SWIFT_NAME(deleteAllIndexes());
  45. @end
  46. NS_ASSUME_NONNULL_END