{
  "api": {
    "name": "CapgoCompassPlugin",
    "slug": "capgocompassplugin",
    "docs": "Capacitor Compass Plugin interface for reading device compass heading.",
    "tags": [
      {
        "text": "7.0.0",
        "name": "since"
      }
    ],
    "methods": [
      {
        "name": "getCurrentHeading",
        "signature": "() => Promise<CompassHeading>",
        "parameters": [],
        "returns": "Promise<CompassHeading>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves with the compass heading"
          },
          {
            "name": "throws",
            "text": "Error if compass is not available or permission denied"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst { value } = await CapgoCompass.getCurrentHeading();\nconsole.log('Compass heading:', value, 'degrees');\n```"
          }
        ],
        "docs": "Get the current compass heading in degrees.\nOn iOS, the heading is updated in the background, and the latest value is returned.\nOn Android, the heading is calculated when the method is called using accelerometer and magnetometer sensors.\nNot implemented on Web.",
        "complexTypes": [
          "CompassHeading"
        ],
        "slug": "getcurrentheading"
      },
      {
        "name": "getPluginVersion",
        "signature": "() => Promise<{ version: string; }>",
        "parameters": [],
        "returns": "Promise<{ version: string; }>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves with the plugin version"
          },
          {
            "name": "throws",
            "text": "Error if getting the version fails"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst { version } = await CapgoCompass.getPluginVersion();\nconsole.log('Plugin version:', version);\n```"
          }
        ],
        "docs": "Get the native Capacitor plugin version.",
        "complexTypes": [],
        "slug": "getpluginversion"
      },
      {
        "name": "startListening",
        "signature": "(options?: ListeningOptions | undefined) => Promise<void>",
        "parameters": [
          {
            "name": "options",
            "docs": "- Optional configuration for throttling behavior",
            "type": "ListeningOptions | undefined"
          }
        ],
        "returns": "Promise<void>",
        "tags": [
          {
            "name": "param",
            "text": "options - Optional configuration for throttling behavior"
          },
          {
            "name": "returns",
            "text": "Promise that resolves when listening starts"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\n// With default throttling (100ms interval, 2° minimum change)\nawait CapgoCompass.startListening();\n\n// With custom throttling for high-frequency updates\nawait CapgoCompass.startListening({\n  minInterval: 50,      // 50ms between events\n  minHeadingChange: 1.0 // 1° minimum change\n});\n\nCapgoCompass.addListener('headingChange', (event) => {\n  console.log('Heading:', event.value);\n});\n```"
          }
        ],
        "docs": "Start listening for compass heading changes via events.\nThis starts the compass sensors and emits 'headingChange' events.",
        "complexTypes": [
          "ListeningOptions"
        ],
        "slug": "startlistening"
      },
      {
        "name": "stopListening",
        "signature": "() => Promise<void>",
        "parameters": [],
        "returns": "Promise<void>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves when listening stops"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nawait CapgoCompass.stopListening();\n```"
          }
        ],
        "docs": "Stop listening for compass heading changes.\nThis stops the compass sensors and stops emitting events.",
        "complexTypes": [],
        "slug": "stoplistening"
      },
      {
        "name": "addListener",
        "signature": "(eventName: 'headingChange', listenerFunc: (event: HeadingChangeEvent) => void) => Promise<{ remove: () => Promise<void>; }>",
        "parameters": [
          {
            "name": "eventName",
            "docs": "- The event to listen for ('headingChange')",
            "type": "'headingChange'"
          },
          {
            "name": "listenerFunc",
            "docs": "- The function to call when the event is emitted",
            "type": "(event: HeadingChangeEvent) => void"
          }
        ],
        "returns": "Promise<{ remove: () => Promise<void>; }>",
        "tags": [
          {
            "name": "param",
            "text": "eventName - The event to listen for ('headingChange')"
          },
          {
            "name": "param",
            "text": "listenerFunc - The function to call when the event is emitted"
          },
          {
            "name": "returns",
            "text": "A promise that resolves with a handle to remove the listener"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst handle = await CapgoCompass.addListener('headingChange', (event) => {\n  console.log('Heading:', event.value, 'degrees');\n});\n// Later: handle.remove();\n```"
          }
        ],
        "docs": "Add a listener for compass heading change events.",
        "complexTypes": [
          "HeadingChangeEvent"
        ],
        "slug": "addlistenerheadingchange-"
      },
      {
        "name": "addListener",
        "signature": "(eventName: 'accuracyChange', listenerFunc: (event: AccuracyChangeEvent) => void) => Promise<{ remove: () => Promise<void>; }>",
        "parameters": [
          {
            "name": "eventName",
            "docs": "- The event to listen for ('accuracyChange')",
            "type": "'accuracyChange'"
          },
          {
            "name": "listenerFunc",
            "docs": "- The function to call when the event is emitted",
            "type": "(event: AccuracyChangeEvent) => void"
          }
        ],
        "returns": "Promise<{ remove: () => Promise<void>; }>",
        "tags": [
          {
            "name": "param",
            "text": "eventName - The event to listen for ('accuracyChange')"
          },
          {
            "name": "param",
            "text": "listenerFunc - The function to call when the event is emitted"
          },
          {
            "name": "returns",
            "text": "A promise that resolves with a handle to remove the listener"
          },
          {
            "name": "since",
            "text": "8.2.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst handle = await CapgoCompass.addListener('accuracyChange', (event) => {\n  console.log('Compass accuracy:', event.accuracy);\n});\n// Later: handle.remove();\n```"
          }
        ],
        "docs": "Add a listener for compass accuracy change events.\nOnly supported on Android. On iOS and Web, this will never emit events.",
        "complexTypes": [
          "AccuracyChangeEvent"
        ],
        "slug": "addlisteneraccuracychange-"
      },
      {
        "name": "removeAllListeners",
        "signature": "() => Promise<void>",
        "parameters": [],
        "returns": "Promise<void>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves when all listeners are removed"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nawait CapgoCompass.removeAllListeners();\n```"
          }
        ],
        "docs": "Remove all listeners for this plugin.",
        "complexTypes": [],
        "slug": "removealllisteners"
      },
      {
        "name": "checkPermissions",
        "signature": "() => Promise<PermissionStatus>",
        "parameters": [],
        "returns": "Promise<PermissionStatus>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves with the permission status"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst status = await CapgoCompass.checkPermissions();\nconsole.log('Compass permission:', status.compass);\n```"
          }
        ],
        "docs": "Check the current permission status for accessing compass data.\nOn iOS, this checks location permission status.\nOn Android, this always returns 'granted' as no permissions are required.",
        "complexTypes": [
          "PermissionStatus"
        ],
        "slug": "checkpermissions"
      },
      {
        "name": "requestPermissions",
        "signature": "() => Promise<PermissionStatus>",
        "parameters": [],
        "returns": "Promise<PermissionStatus>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves with the new permission status"
          },
          {
            "name": "since",
            "text": "7.0.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst status = await CapgoCompass.requestPermissions();\nif (status.compass === 'granted') {\n  // Can now use compass\n}\n```"
          }
        ],
        "docs": "Request permission to access compass data.\nOn iOS, this requests location permission (required for heading data).\nOn Android, this resolves immediately as no permissions are required.",
        "complexTypes": [
          "PermissionStatus"
        ],
        "slug": "requestpermissions"
      },
      {
        "name": "watchAccuracy",
        "signature": "() => Promise<void>",
        "parameters": [],
        "returns": "Promise<void>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves when monitoring starts"
          },
          {
            "name": "since",
            "text": "8.2.0"
          },
          {
            "name": "example",
            "text": "```typescript\n// Start monitoring accuracy\nawait CapgoCompass.watchAccuracy();\n\n// Listen for accuracy changes and implement custom UI\nCapgoCompass.addListener('accuracyChange', (event) => {\n  console.log('Accuracy changed to:', event.accuracy);\n  if (event.accuracy < CompassAccuracy.MEDIUM) {\n    // Show your custom calibration UI\n  }\n});\n```"
          }
        ],
        "docs": "Start monitoring compass accuracy.\nOn Android, this monitors the magnetometer accuracy and emits accuracyChange events.\nDevelopers can listen to these events and implement their own UI for calibration prompts.\nOn iOS and Web, this method does nothing as compass accuracy monitoring is not available.",
        "complexTypes": [],
        "slug": "watchaccuracy"
      },
      {
        "name": "unwatchAccuracy",
        "signature": "() => Promise<void>",
        "parameters": [],
        "returns": "Promise<void>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves when monitoring stops"
          },
          {
            "name": "since",
            "text": "8.2.0"
          },
          {
            "name": "example",
            "text": "```typescript\nawait CapgoCompass.unwatchAccuracy();\n```"
          }
        ],
        "docs": "Stop monitoring compass accuracy.\nThis stops the accuracy monitoring.",
        "complexTypes": [],
        "slug": "unwatchaccuracy"
      },
      {
        "name": "getAccuracy",
        "signature": "() => Promise<{ accuracy: CompassAccuracy; }>",
        "parameters": [],
        "returns": "Promise<{ accuracy: CompassAccuracy; }>",
        "tags": [
          {
            "name": "returns",
            "text": "Promise that resolves with the current accuracy level"
          },
          {
            "name": "since",
            "text": "8.2.0"
          },
          {
            "name": "example",
            "text": "```typescript\nconst { accuracy } = await CapgoCompass.getAccuracy();\nif (accuracy < CompassAccuracy.MEDIUM) {\n  console.log('Compass needs calibration');\n}\n```"
          }
        ],
        "docs": "Get the current compass accuracy level.\nOn Android, returns the current magnetometer sensor accuracy.\nOn iOS and Web, always returns CompassAccuracy.UNKNOWN as accuracy monitoring is not available.",
        "complexTypes": [
          "CompassAccuracy"
        ],
        "slug": "getaccuracy"
      }
    ],
    "properties": []
  },
  "interfaces": [
    {
      "name": "CompassHeading",
      "slug": "compassheading",
      "docs": "Result containing the compass heading value.",
      "tags": [
        {
          "text": "7.0.0",
          "name": "since"
        }
      ],
      "methods": [],
      "properties": [
        {
          "name": "value",
          "tags": [],
          "docs": "Compass heading in degrees (0-360)",
          "complexTypes": [],
          "type": "number"
        }
      ]
    },
    {
      "name": "ListeningOptions",
      "slug": "listeningoptions",
      "docs": "Options for configuring compass listening behavior.",
      "tags": [
        {
          "text": "8.1.4",
          "name": "since"
        }
      ],
      "methods": [],
      "properties": [
        {
          "name": "minInterval",
          "tags": [
            {
              "text": "100",
              "name": "default"
            },
            {
              "text": "8.1.4",
              "name": "since"
            }
          ],
          "docs": "Minimum interval between heading change events in milliseconds.\nLower values = more frequent updates but higher CPU/battery usage.",
          "complexTypes": [],
          "type": "number | undefined"
        },
        {
          "name": "minHeadingChange",
          "tags": [
            {
              "text": "2.0",
              "name": "default"
            },
            {
              "text": "8.1.4",
              "name": "since"
            }
          ],
          "docs": "Minimum heading change in degrees required to trigger an event.\nLower values = more sensitive but more events.\nHandles wraparound (e.g., 359° to 1° = 2° change).",
          "complexTypes": [],
          "type": "number | undefined"
        }
      ]
    },
    {
      "name": "HeadingChangeEvent",
      "slug": "headingchangeevent",
      "docs": "Event data for heading change events.",
      "tags": [
        {
          "text": "7.0.0",
          "name": "since"
        }
      ],
      "methods": [],
      "properties": [
        {
          "name": "value",
          "tags": [],
          "docs": "Compass heading in degrees (0-360)",
          "complexTypes": [],
          "type": "number"
        }
      ]
    },
    {
      "name": "AccuracyChangeEvent",
      "slug": "accuracychangeevent",
      "docs": "Event data for accuracy change events.",
      "tags": [
        {
          "text": "8.2.0",
          "name": "since"
        }
      ],
      "methods": [],
      "properties": [
        {
          "name": "accuracy",
          "tags": [],
          "docs": "Current accuracy level of the compass",
          "complexTypes": [
            "CompassAccuracy"
          ],
          "type": "CompassAccuracy"
        }
      ]
    },
    {
      "name": "PermissionStatus",
      "slug": "permissionstatus",
      "docs": "Permission status for compass plugin.",
      "tags": [
        {
          "text": "7.0.0",
          "name": "since"
        }
      ],
      "methods": [],
      "properties": [
        {
          "name": "compass",
          "tags": [
            {
              "text": "7.0.0",
              "name": "since"
            }
          ],
          "docs": "Permission state for accessing compass/location data.\nOn iOS, this requires location permission to access heading.\nOn Android, no special permissions are required for compass sensors.",
          "complexTypes": [
            "PermissionState"
          ],
          "type": "PermissionState"
        }
      ]
    }
  ],
  "enums": [
    {
      "name": "CompassAccuracy",
      "slug": "compassaccuracy",
      "members": [
        {
          "name": "HIGH",
          "value": "3",
          "tags": [],
          "docs": "High accuracy - approximates to less than 5 degrees of error"
        },
        {
          "name": "MEDIUM",
          "value": "2",
          "tags": [],
          "docs": "Medium accuracy - approximates to less than 10 degrees of error"
        },
        {
          "name": "LOW",
          "value": "1",
          "tags": [],
          "docs": "Low accuracy - approximates to less than 15 degrees of error"
        },
        {
          "name": "UNRELIABLE",
          "value": "0",
          "tags": [],
          "docs": "Unreliable accuracy - approximates to more than 15 degrees of error"
        },
        {
          "name": "UNKNOWN",
          "value": "-1",
          "tags": [],
          "docs": "Unknown accuracy value"
        }
      ]
    }
  ],
  "typeAliases": [
    {
      "name": "PermissionState",
      "slug": "permissionstate",
      "docs": "",
      "types": [
        {
          "text": "'prompt'",
          "complexTypes": []
        },
        {
          "text": "'prompt-with-rationale'",
          "complexTypes": []
        },
        {
          "text": "'granted'",
          "complexTypes": []
        },
        {
          "text": "'denied'",
          "complexTypes": []
        }
      ]
    }
  ],
  "pluginConfigs": []
}